Failed to resolve entry for package "@intlify/shared"

小小编辑 1年前 ⋅ 458 阅读

问题

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');
        ╵                      ~~~~~~~~~~~~~~~~~

14:12:00 [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/vite/dist/node/chunks/dep-c9998dc6.js:40970:10: ERROR: [plugin: vite:dep-pre-bundle] 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 "." entry in "@intlify/shared" package

解决办法 修改vite.config.ts 微信图片_20230912115216.png 或者 微信图片_20230912115216_1.png