i am facing an issue related to vue-i18n package during the build (npm run build)
[commonjs--resolver] Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "@intlify/shared" package
file: /home/jtissa/Desktop/metronic/vue/metronic_vue_v8.2.0_demo7/demo7/node_modules/vue-i18n/dist/vue-i18n.cjs.js
error during build:
Error: Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "@intlify/shared" package
at packageEntryFailure (file:///home/jtissa/Desktop/metronic/vue/metronic_vue_v8.2.0_demo7/demo7/node_modules/vite/dist/node/chunks/dep-df561101.js:28691:11)
at resolvePackageEntry (file:///home/jtissa/Desktop/metronic/vue/metronic_vue_v8.2.0_demo7/demo7/node_modules/vite/dist/node/chunks/dep-df561101.js:28686:9)
at tryNodeResolve (file:///home/jtissa/Desktop/metronic/vue/metronic_vue_v8.2.0_demo7/demo7/node_modules/vite/dist/node/chunks/dep-df561101.js:28419:20)
at Object.resolveId (file:///home/jtissa/Desktop/metronic/vue/metronic_vue_v8.2.0_demo7/demo7/node_modules/vite/dist/node/chunks/dep-df561101.js:28180:28)
at file:///home/jtissa/Desktop/metronic/vue/metronic_vue_v8.2.0_demo7/demo7/node_modules/rollup/dist/es/shared/node-entry.js:25518:40
at async PluginDriver.hookFirstAndGetPlugin (file:///home/jtissa/Desktop/metronic/vue/metronic_vue_v8.2.0_demo7/demo7/node_modules/rollup/dist/es/shared/node-entry.js:25418:28)
at async resolveId (file:///home/jtissa/Desktop/metronic/vue/metronic_vue_v8.2.0_demo7/demo7/node_modules/rollup/dist/es/shared/node-entry.js:24091:26)
at async ModuleLoader.resolveId (file:///home/jtissa/Desktop/metronic/vue/metronic_vue_v8.2.0_demo7/demo7/node_modules/rollup/dist/es/shared/node-entry.js:24505:15)
at async file:///home/jtissa/Desktop/metronic/vue/metronic_vue_v8.2.0_demo7/demo7/node_modules/vite/dist/node/chunks/dep-df561101.js:8107:16
at async Promise.all (index 0)
ERROR: "build-only" exited with 1.
any ideas or solutions for this type of error??
I also got the same error.
PS C:\xampp\htdocs\vue\demo1> npm -v
10.1.0
PS C:\xampp\htdocs\vue\demo1> npm install
added 469 packages, and audited 470 packages in 2m
125 packages are looking for funding
run `npm fund` for details
2 vulnerabilities (1 low, 1 moderate)
To address issues that do not require attention, run:
npm audit fix
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
PS C:\xampp\htdocs\vue\demo1> npm run dev
> demo1@8.2.0 dev
> vite
VITE v4.4.9 ready in 786 ms
â Local: http://localhost:5173/metronic8/vue/demo1/
â Network: use --host to expose
â press h to show help
X [ERROR] Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "@intlify/shared" package [plugin vite:dep-pre-bundle]
node_modules/esbuild/lib/main.js:1373:21:
1373 â let result = await callback({
âµ ^
at packageEntryFailure (file:///C:/xampp/htdocs/vue/demo1/node_modules/vite/dist/node/chunks/dep-df561101.js:28691:11)
at resolvePackageEntry (file:///C:/xampp/htdocs/vue/demo1/node_modules/vite/dist/node/chunks/dep-df561101.js:28686:9)
at tryNodeResolve (file:///C:/xampp/htdocs/vue/demo1/node_modules/vite/dist/node/chunks/dep-df561101.js:28419:20)
at Context.resolveId (file:///C:/xampp/htdocs/vue/demo1/node_modules/vite/dist/node/chunks/dep-df561101.js:28180:28)
at Object.resolveId (file:///C:/xampp/htdocs/vue/demo1/node_modules/vite/dist/node/chunks/dep-df561101.js:44207:64)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///C:/xampp/htdocs/vue/demo1/node_modules/vite/dist/node/chunks/dep-df561101.js:65837:21
at async file:///C:/xampp/htdocs/vue/demo1/node_modules/vite/dist/node/chunks/dep-df561101.js:39941:34
at async requestCallbacks.on-resolve (C:\xampp\htdocs\vue\demo1\node_modules\esbuild\lib\main.js:1373:22)
at async handleRequest (C:\xampp\htdocs\vue\demo1\node_modules\esbuild\lib\main.js:729:13)
This error came from the "onResolve" callback registered here:
node_modules/esbuild/lib/main.js:1292:20:
1292 â let promise = setup({
âµ ^
at setup (file:///C:/xampp/htdocs/vue/demo1/node_modules/vite/dist/node/chunks/dep-df561101.js:39921:19)
at handlePlugins (C:\xampp\htdocs\vue\demo1\node_modules\esbuild\lib\main.js:1292:21)
at buildOrContextImpl (C:\xampp\htdocs\vue\demo1\node_modules\esbuild\lib\main.js:978:5)
at Object.buildOrContext (C:\xampp\htdocs\vue\demo1\node_modules\esbuild\lib\main.js:786:5)
at C:\xampp\htdocs\vue\demo1\node_modules\esbuild\lib\main.js:2186:68
at new Promise (<anonymous>)
at Object.context (C:\xampp\htdocs\vue\demo1\node_modules\esbuild\lib\main.js:2186:27)
at prepareEsbuildOptimizerRun (file:///C:/xampp/htdocs/vue/demo1/node_modules/vite/dist/node/chunks/dep-df561101.js:45967:35)
The plugin "vite:dep-pre-bundle" was triggered by this import
node_modules/vue-i18n/dist/vue-i18n.cjs:8:21:
8 â var shared = require('@intlify/shared');
âµ ~~~~~~~~~~~~~~~~~
I tried editing "vue-i18n": "9.2.2", but still can't fix it. Hope to receive support soon!
Hi,
Do you still have this error?
This error should already be fixed by vue-i18n team. See Github issue.
If you still have this error or any other problems please create a new post using this form.
Regards,
Lauris Stepanovs,
Keenthemes Support Team
A few days ago I had to work on version 8.1.8
As per your instructions, I followed and got it working on version 8.2.0. Thank you very much!
VITE v4.4.9 ready in 888 ms
â Local: http://localhost:5173/metronic8/vue/demo1/
â Network: use --host to expose
â press h to show help
Hi,
Thank you for your feedback.
We have reproduced this error, and it seems to be an issue in the vue-i18n source code. We are working on an update to fix this problem, and it will be released as soon as possible.
In the meantime, as a temporary solution, you can manually update the vue-i18n dependency to version 9.2.2 in your package.json file:
"vue-i18n": "9.2.2",
Thank you solved
Hi,
Glad to hear that. All the best with your project!
Please let us know if you have any further questions on this topic or anything else.
Regards,
Lauris Stepanovs,
Keenthemes Support Team