nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.74k stars 478 forks source link

Could not read from file: /node_modules/dist/vue-i18n.mjs #1794

Closed k0mar12 closed 1 year ago

k0mar12 commented 1 year ago

Environment

Reproduction

Repo

Describe the bug

While using vuetify@3.1.1 and @nuxtjs/i18n@8.0.0-beta.7 i got error when vuetify cant find vue-i18n Modules work individually, but fail together.

Additional context

No response

Logs

✘ [ERROR] Could not read from file: /Users/vladposhvaniuk/Documents/develop/web/own/nuxt3/node_modules/dist/vue-i18n.mjs

    node_modules/@nuxtjs/i18n/node_modules/vue-i18n-routing/node_modules/@intlify/vue-i18n-bridge/lib/index.mjs:10:14:
      10 │ export * from 'vue-i18n'
         ╵               ~~~~~~~~~~

 ERROR  3:34:01 PM [vite] error while updating dependencies:                                                   15:34:01
Error: Build failed with 1 error:
node_modules/@nuxtjs/i18n/node_modules/vue-i18n-routing/node_modules/@intlify/vue-i18n-bridge/lib/index.mjs:10:14: ERROR: Could not read from file: /Users/vladposhvaniuk/Documents/develop/web/own/nuxt3/node_modules/dist/vue-i18n.mjs
    at failureErrorWithLog (/Users/vladposhvaniuk/Documents/develop/web/own/nuxt3/node_modules/esbuild/lib/main.js:1575:15)
    at /Users/vladposhvaniuk/Documents/develop/web/own/nuxt3/node_modules/esbuild/lib/main.js:1033:28
    at runOnEndCallbacks (/Users/vladposhvaniuk/Documents/develop/web/own/nuxt3/node_modules/esbuild/lib/main.js:1447:61)
    at buildResponseToResult (/Users/vladposhvaniuk/Documents/develop/web/own/nuxt3/node_modules/esbuild/lib/main.js:1031:7)
    at /Users/vladposhvaniuk/Documents/develop/web/own/nuxt3/node_modules/esbuild/lib/main.js:1143:14
    at responseCallbacks.<computed> (/Users/vladposhvaniuk/Documents/develop/web/own/nuxt3/node_modules/esbuild/lib/main.js:680:9)
    at handleIncomingPacket (/Users/vladposhvaniuk/Documents/develop/web/own/nuxt3/node_modules/esbuild/lib/main.js:735:9)
    at Socket.readFromStdout (/Users/vladposhvaniuk/Documents/develop/web/own/nuxt3/node_modules/esbuild/lib/main.js:656:7)                                                                                                             15:33:58
    at Socket.emit (node:events:513:28)
    at Socket.emit (node:domain:489:12)
zbLiuLiu commented 1 year ago

Add"overrides": { "vue-i18n": "^9.3.0-beta.16" } to your package.json.

k0mar12 commented 1 year ago

@zbLiuLiu Yeah, thanks. I know about this hack. But this is not working as you describe, overrides little diff:

{
  "dependencies": {
    "vue-i18n": "^9.3.0-beta.16",
    "vuetify": "^3.1.1"
  },
  "overrides": {
    "vuetify": {
      "vue-i18n": "$vue-i18n"
    }
  }
zbLiuLiu commented 1 year ago

@k0mar12 This is my package.json, I just created my project yesterday:

{
  ...
  "devDependencies": {
    ...
    "@nuxtjs/i18n": "^8.0.0-beta.7",
    "nuxt": "^3.0.0"
  },
  "dependencies": {
    ...
    "vue-i18n": "^9.3.0-beta.16",
    "vuetify": "^3.1.1"
  },
  "overrides": {
    "vue-i18n": "^9.3.0-beta.16"
  }
}