Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Number field broken since 3.13.0 - $tc is not a function #453

Open
1 task done
poacher2k opened this issue Jan 15, 2025 · 6 comments
Open
1 task done

[Bug]: Number field broken since 3.13.0 - $tc is not a function #453

poacher2k opened this issue Jan 15, 2025 · 6 comments
Labels
type: bug 🐛 Something isn't working

Comments

@poacher2k
Copy link

Package

@meteor/component-library

Package version

^3.13.0

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-bnlbnnhr?file=src%2FApp.vue

Steps to reproduce

  1. Use mt-number-field

Actual behavior

An error occurs

Expected behavior

It should work without an error

System Info

Any additional comments?

Likely caused by this line: 3ddcd26#diff-8b997c46fb1e29550a38c10a142ec996c5df0cfca1caed44c84b8f82df497ddeR49

In our environment we have no $tc defined globally.

Code of Conduct

@poacher2k poacher2k added the type: bug 🐛 Something isn't working label Jan 15, 2025
@poacher2k poacher2k changed the title [Bug]: $tc is not a function [Bug]: Number field broken since 3.13.0 - $tc is not a function Jan 15, 2025
@Haberkamp
Copy link
Contributor

Hi, could it be that your app does not use vue-i18n? You can't use Meteor without using vue-i18n version 9. I could fix it by installing it, creating it like this:

const i18n = createI18n({
  locale: 'en'
});

and then using it like this:

app.use(i18n)

@poacher2k
Copy link
Author

Hi, could it be that your app does not use vue-i18n? You can't use Meteor without using vue-i18n version 9. I could fix it by installing it, creating it like this:

Our app does indeed use vue-i18n, and works fine with 3.12.0. The update linked above in 3.13.0 broke our app as the $tc function is not defined, and this is likely the same for others too. Perhaps this wasn't noticed because of

?

@Haberkamp
Copy link
Contributor

Haberkamp commented Jan 15, 2025

Is it possible for you to send me a more detailed vue-i18n configuration? Once I add the basic vue-i18n configuration to the minimal reproducable instance you sent me everything works as expected. The error is gone.

@poacher2k
Copy link
Author

Is it possible for you to send me a more detailed vue-i18n configuration? Once I add the basic vue-i18n configuration to the minimal reproducable instance you sent me everything works as expected. The error is gone.

Here is one with vue-i18n: https://stackblitz.com/edit/vitejs-vite-bnlbnnhr?file=package.json

@Haberkamp
Copy link
Contributor

Ok, so the issues happens because vue-i18n is configured to not use the legacy mode.

A few ways to fix this bug:

  1. Enable the legacy mode and migrate all transitions over to the Options API
  2. Upgrade Meteor to 4.0.0 where all translations use the Composition API
  3. Use this hack

The reason this bug appears is because Meteor 3 still uses the Options API to do translations and vue-i18n only allows you to either use the Options API or the Composition API.

@poacher2k
Copy link
Author

@Haberkamp : We already reverted to 3.12.0, and while the fixes you outline works, this patch commit was still a breaking change, so you might consider reverting this for ^3 regardless, as it might be broken for more people too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants