Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue-i18n-bridge 9.3.0 peer dependency warning #1529

Closed
4 tasks done
kingyue737 opened this issue Sep 8, 2023 · 2 comments · Fixed by #1536
Closed
4 tasks done

vue-i18n-bridge 9.3.0 peer dependency warning #1529

kingyue737 opened this issue Sep 8, 2023 · 2 comments · Fixed by #1536
Labels
🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage Status: PR Welcome Welcome to Pull Request

Comments

@kingyue737
Copy link
Contributor

kingyue737 commented Sep 8, 2023

Reporting a bug?

Add [email protected] will also add @vue/composition-api as its dependency which conflicts with [email protected].

 WARN  Issues with peer dependencies found
.
└─┬ vue-i18n-bridge 9.3.0
  └─┬ @vue/composition-api 1.7.2
    └── ✕ unmet peer vue@">= 2.5 < 2.7": found 2.7.14 

Expected behavior

No dependency warning

Reproduction

https://stackblitz.com/edit/vitejs-vite-fjumap

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (6) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.20.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.6.10 - /usr/local/bin/pnpm
  npmPackages:
    vite: ^4.4.9 => 4.4.9 
    vue: 2.7.14 => 2.7.14 
    vue-i18n-bridge: ^9.3.0 => 9.3.0

Screenshot

image

Additional context

Run pnpm update or add whatever dependency will show the warning

Validations

@kingyue737 kingyue737 added the Status: Review Needed Request for review comments label Sep 8, 2023
@kazupon kazupon added Status: PR Welcome Welcome to Pull Request 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage and removed Status: Review Needed Request for review comments labels Sep 8, 2023
Copy link
Member

kazupon commented Sep 11, 2023

Thank you for reporting!

Hmm, 🤔
vue-i18n-bridge is defining @vue/composition-api as optionalDependencies.
https://github.com/intlify/vue-i18n-next/blob/1124ef852d9a6c1b13da90369c6705cd8edcf74a/packages/vue-i18n-bridge/package.json#L48C4-L49

peerDependencies of vue-demi might be having an effect.
https://github.com/vueuse/vue-demi/blob/main/package.json#L39

As the workaround, you can overrides with package manager.
example for pnpm:

  "pnpm": {
    "overrides": {
      "@vue/composition-api": "<1.7.0"
    }
  },

@kingyue737
Copy link
Contributor Author

kingyue737 commented Sep 11, 2023

It seems that optionalDependencies are installed by default without --no-optional
https://pnpm.io/cli/install#--no-optional

Use peerDependenciesMeta like what vue-demi does may be a better way
https://github.com/vueuse/vue-demi/blob/80b8e939134c4d8e9457bd97235a46712ea0988a/package.json#L44

Curious why this change was made 7af7c1b

I'm not familiar with library development. Since vue-i18n-bridge does not import any API from @vue/composition-api directly. Do we still need to add @vue/composition-api in package.json? Is it enough to just rely on vue-demi?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage Status: PR Welcome Welcome to Pull Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants