nuxt-modules / i18n

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

Removal of @vue/composition-api/ vue-i18n-routing so that there is no unmet peer vue@">= 2.5 < 2.7": found 3.2.41 #1577

Closed buffet-time closed 1 year ago

buffet-time commented 2 years ago

Is your feature request related to a problem? Please describe.

Removal of peer dependency: vue between 2.5 and 2.7 for 8.0.0+ that comes from usage of @vue/composition-api

Given Nuxt 3 and usage of 8.0.0 is designed for Nuxt 3, having a peer dependency of a version of Vue which is not being used for the Nuxt app seems incorrect.

Additional context

/e/Programming/leaderboard-site (nuxt3FixVitest)
$ pnpm upgrade
 WARN  deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
Already up to date
Progress: resolved 1041, reused 1019, downloaded 0, added 0, done

> leaderboardsgg@1.0.0 prepare E:\Programming\leaderboard-site
> husky install

husky - Git hooks installed
 WARN  Issues with peer dependencies found
.
└─┬ @nuxtjs/i18n 8.0.0-alpha.3
  └─┬ vue-i18n-routing 0.6.0
    └─┬ @vue/composition-api 1.7.1
      └── ✕ unmet peer vue@">= 2.5 < 2.7": found 3.2.41

Done in 5.8s
kazupon commented 2 years ago

Thank you for your reporting! Unfortunately, I could not reproduce this issue.

Could you give us your minimum reproduction repo with stackbliz or github repo please? 🙏

buffet-time commented 2 years ago

Hello,

so i made for simple demonstration this: https://stackblitz.com/edit/nuxt-starter-zq7n28?file=package.json

It's just using Stackblitz own started Nuxt 3, and then added the following packages: "@nuxtjs/i18n": "8.0.0-beta.1" and for peerDependency reasons "vue": "3.2.41"

And then if you run in the integrated terminal pnpm install you'll see

 WARN  Issues with peer dependencies found
.
└─┬ @nuxtjs/i18n 8.0.0-beta.1
  └─┬ vue-i18n-routing 0.7.0
    └─┬ @vue/composition-api 1.7.1
      └── ✕ unmet peer vue@">= 2.5 < 2.7": found 3.2.41
kazupon commented 2 years ago

Thank you for your more information! I reproduced this issue in pnpm install Hmm, Package managers behave differently, which is hard...

In vue-i18n-routing, @vue/composition-api is defined by optionalDependencies (as reason for vue-i18n-routing requires @vue/composition-api as optionalDependencies because we want to provide it for Vue 2 as well) https://github.com/intlify/routing/blob/c9fd4c93613c0bf5bf9a32af4c74babddc90161e/packages/vue-i18n-routing/package.json#L59-L61

when this module has been installed by npm (in my env v8.5.1), no error. in about yarn v1.22.9, warning only and installation is successfuly.

As a workaround, you can use pnpm.peerDependencyRules.ignoreMissing to avoid the following

package.json:

{
  "pnpm": {
    "peerDependencyRules": {
      "ignoreMissing": ["vue"]
    }
  }
}
kazupon commented 2 years ago

Fixed in v8.0.0-beta.2! Please check it!

buffet-time commented 2 years ago

Thank you @kazupon ! And keep up the great work you do!!

ErriourMe commented 2 years ago

Still happening with v8.0.0-beta.3:

 WARN  Issues with peer dependencies found
.
└─┬ @nuxtjs/i18n 8.0.0-beta.3
  └─┬ vue-i18n-routing 0.8.2
    └─┬ @vue/composition-api 1.7.1
      └── ✕ unmet peer vue@">= 2.5 < 2.7": found 3.2.41
robertoshimizu commented 2 years ago

I have faced the same issue, in a newly and fresh nuxt3 project installed via pnpm and after having installed @nuxtjs/tailwindcss.

dependencies:
+ @nuxtjs/i18n 8.0.0-beta.3

 WARN  Issues with peer dependencies found
.
├─┬ @nuxtjs/i18n 8.0.0-beta.3
│ ├─┬ @intlify/unplugin-vue-i18n 0.7.1
│ │ └─┬ unplugin 0.8.1
│ │   └── ✕ missing peer webpack@"4 || 5"
│ ├─┬ vue-i18n 9.3.0-beta.6
│ │ └── ✕ missing peer vue@^3.0.0
│ └─┬ vue-i18n-routing 0.8.2
│   ├── ✕ missing peer vue@"^2.6.14 || ^2.7.0 || ^3.2.0"
│   ├─┬ @vue/composition-api 1.7.1
│   │ └── ✕ missing peer vue@">= 2.5 < 2.7"
│   └─┬ @intlify/vue-router-bridge 0.7.0
│     └─┬ vue-demi 0.13.11
│       └── ✕ missing peer vue@"^3.0.0-0 || ^2.6.0"
└─┬ @nuxtjs/tailwindcss 6.1.3
  └─┬ @nuxt/postcss8 1.1.3
    ├─┬ css-loader 5.2.7
    │ └── ✕ missing peer webpack@"^4.27.0 || ^5.0.0"
    └─┬ postcss-loader 4.3.0
      └── ✕ missing peer webpack@"^4.0.0 || ^5.0.0"
✕ Conflicting peer dependencies:
  vue  
Peer dependencies that should be installed:
  webpack@">=4.27.0 <5.0.0 || >=5.0.0 <6.0.0"  

Done in 10.3s
kazupon commented 2 years ago

related (cause) issue: https://github.com/intlify/routing/issues/19

kazupon commented 2 years ago

I've just fixed. You can try to use with edge version. Please try it!

Thanks!

Ingramz commented 2 years ago

Hi! @intlify/vue-i18n-bridge and @intlify/vue-router-bridge require the same fix to be applied.

kazupon commented 1 year ago

I've just fixed and release edge version @nuxtjs/i18n-edge@8.0.0-beta.4-27812700.b832f07 Please check it!