Closed RollingTL closed 3 years ago
Tested also version 9.0.0-beta.9 and got even more terrifying error:
Uncaught ReferenceError: exports is not defined
at Module.<anonymous> (vue-i18n.esm-browser.js:192)
at Module../node_modules/vue-i18n/dist/vue-i18n.esm-browser.js (vue-i18n.esm-browser.js:4857)
at __webpack_require__ (bootstrap:848)
at fn (bootstrap:150)
at Module../src/modules/useLocale.ts (useLocale.ts:1)
at __webpack_require__ (bootstrap:848)
at fn (bootstrap:150)
at Module../node_modules/cache-loader/dist/cjs.js?!./node_modules/ts-loader/index.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js?!./src/App.vue?vue&type=script&lang=ts (App.vue?1d14:2)
at __webpack_require__ (bootstrap:848)
at fn (bootstrap:150)
Version 9.0.0-beta.8 works fine.
hi, @RollingTL . I just updated to latest version of this library without any issue.
Pls try to delete "node_modules" folder and "package-lock.json" file and install again. May be need to clean npm cache also(as last option)
Thank you for you reporting!
I seem that you are using VUe I18n in Composition API mode.
In Composition API mode, you can't use an API prefixed with $
and injected into a component.
To use it, you need to set to globalInjection: true
at createI18n
.
See details here: https://vue-i18n-next.intlify.dev/advanced/composition.html#implicit-with-injected-properties-and-functions
To use it, you need to set to globalInjection: true at createI18n
Thats it! Thank you. All is working now.
"vue-i18n": "^9.0.0-beta.10", "vue": "^3.0.4"
The error when using i18n-next globally - Uncaught (in promise) TypeError: _ctx.$t is not a function
This happened after I had done npm update today. All was working fine before. The only change was versions updating.
Thats how I plug in i18n: main.ts
Thats client code causing error: client.vue
Last package.json:
Previous package.json: