nuxt-modules / i18n

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

Dependency mismatch in `v9.0.0-rc.1` #3152

Closed shrpne closed 1 month ago

shrpne commented 1 month ago

Environment

Reproduction

On the local environment and on the stackblitz I have different errors, but both envs not working for me

On stackblitz I have Pre-transform error: compiler is null (x2) https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-rt9kda?file=i18n%2Fi18n.config.ts

On the local I have

 [ERROR] No matching export in "node_modules/@intlify/shared/dist/shared.mjs" for import "incrementer"

    node_modules/@intlify/core-base/dist/core-base.mjs:6:121:
      6 │ ...mber, isPlainObject, assign, join, toDisplayString, isArray, incrementer, format as format$1, isPromise, isBoolean, warn, isRegExp, ...
        ╵                                                                 ~~~~~~~~~~~

 ERROR  error while updating dependencies:                                                                                             11:05:53 AM
Error: Build failed with 1 error:
node_modules/@intlify/core-base/dist/core-base.mjs:6:121: ERROR: No matching export in "node_modules/@intlify/shared/dist/shared.mjs" for import "incremented"

Describe the bug

v9 rc1 not run

Additional context

npm list @intlify/shared gives

└─┬ @nuxtjs/i18n@9.0.0-rc.1
  ├─┬ @intlify/h3@0.5.0
  │ └─┬ @intlify/core@9.14.1
  │   ├─┬ @intlify/core-base@9.14.1
  │   │ └── @intlify/shared@9.14.1
  │   └── @intlify/shared@9.14.1
  ├── @intlify/shared@10.0.3
  ├─┬ @intlify/unplugin-vue-i18n@5.2.0
  │ ├─┬ @intlify/bundle-utils@9.0.0-beta.0
  │ │ ├─┬ @intlify/message-compiler@9.14.1
  │ │ │ └── @intlify/shared@9.14.1
  │ │ └── @intlify/shared@10.0.3 deduped
  │ ├── @intlify/shared@10.0.3 deduped
  │ └─┬ @intlify/vue-i18n-extensions@7.0.0
  │   └── @intlify/shared@10.0.3 deduped
  └─┬ vue-i18n@10.0.3
    ├─┬ @intlify/core-base@10.0.3
    │ ├─┬ @intlify/message-compiler@10.0.3
    │ │ └── @intlify/shared@10.0.3 deduped
    │ └── @intlify/shared@10.0.3 deduped
    └── @intlify/shared@10.0.3 deduped

probably the issue with intlify/h3 which requires intlify/shared@9

Logs

No response

BobbieGoede commented 1 month ago

Thanks for reporting this issue, you're right it looks like we need to update deps in @intlify/h3 and publish a release.

In the meantime I think you can work around this issue by adding the following resolutions override to your package.json. You may need to refresh lockfiles for this to take effect.

    "resolutions": {
        "@intlify/core": "^10"
    },
shrpne commented 1 month ago

I managed to pin versions on npm with

  "overrides": {
    "@intlify/h3": {
      "@intlify/core": "^10"
    },
    "@intlify/bundle-utils": {
      "@intlify/message-compiler": "^10"
    }
  }
BobbieGoede commented 1 month ago

Ah sorry, resolutions is specific to pnpm, just setting the one override seems to be sufficient in my testing.

  "overrides": {
    "@intlify/h3": {
      "@intlify/core-base": "^10.0.3"
    }
  },

This issue should get resolved once https://github.com/intlify/h3/pull/35 is merged, released (and updated in this module).