vue-i18n
vue-i18n copied to clipboard
You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.
Reporting a bug?
Warning in console.
Expected behavior
no warnings
Reproduction
i used command 'vue add i18n'
System Info
"dependencies": {
"core-js": "^3.8.3",
"register-service-worker": "^1.7.2",
"vue": "^3.2.13",
"vue-i18n": "^9.1.10",
"vue-router": "^4.0.3",
"vuex": "^4.0.0"
},
Screenshot
Additional context
No response
Validations
- [X] Read the Contributing Guidelines
- [X] Read the Documentation
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion
- [X] The provided reproduction is a minimal reproducible example of the bug.
"vue": "3.2.37" "vue-i18n": "9.1.10" devDependencies : "@intlify/vue-i18n-loader": "4.2.0"
I fix it in vue.config.js:
configureWebpack: config => {
config.plugins.push(
new webpack.DefinePlugin({
__INTLIFY_PROD_DEVTOOLS__: false,
__VUE_I18N_FULL_INSTALL__: true,
__VUE_I18N_LEGACY_API__: true
})
)
}
change imort i18n: import { createI18n } from "vue-i18n/index"
@yurizhang getting these errors by just trying that 🧐

Could not find a declaration file for module 'vue-i18n/index'. '/Users/shinigami/Dermalog/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/vue-i18n/index.js' implicitly has an 'any' type.
If the 'vue-i18n' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'vue-i18n/index';`ts(7016)
09:14:45 [vite] page reload src/plugins/i18n.ts
Missing "./index" export in "vue-i18n" package
09:14:45 [vite] Internal server error: Missing "./index" export in "vue-i18n" package
Plugin: vite:import-analysis
File: /Users/shinigami/Dermalog/frontend/src/plugins/i18n.ts
at bail (file:///Users/shinigami/Dermalog/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:33604:8)
at resolve (file:///Users/shinigami/Dermalog/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:33681:10)
at resolveExports (file:///Users/shinigami/Dermalog/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:34422:12)
at resolveDeepImport (file:///Users/shinigami/Dermalog/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:34440:31)
at tryNodeResolve (file:///Users/shinigami/Dermalog/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:34161:20)
at Context.resolveId (file:///Users/shinigami/Dermalog/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:33963:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.resolveId (file:///Users/shinigami/Dermalog/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:35216:32)
at async TransformContext.resolve (file:///Users/shinigami/Dermalog/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:34981:23)
at async normalizeUrl (file:///Users/shinigami/Dermalog/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:40175:34)
This warning is going to be removed in vue-i18n v9.3 or later and later. So close it.