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

Bug: peerDependencies isn't set in the package.json published to npm #2581

Closed
kimulaco opened this issue Jan 2, 2025 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@kimulaco
Copy link

kimulaco commented Jan 2, 2025

Describe the bug

The package.json in the main branch has peerDependencies set, but the package.json actually published to npm does not have peerDependencies set.

This causes an issue in monorepo apps with multiple vue versions where unintended vue versions are imported.
pnpm/pnpm#8917

To Reproduce

Here's a minimal example:
https://github.com/kimulaco/monorepo-vue-example

The problem will not occur if you overwrite peerDependencies with pnpm's packageExtensions.
https://github.com/kimulaco/monorepo-vue-example/tree/add-peerDependencies

Expected behavior

peerDependencies should also be set in the npm published package.json.

Related information:

❯ npx envinfo --system --npmPackages vue,@vue/test-utils,vitest,jest

  System:
    OS: macOS 14.6.1
    CPU: (8) arm64 Apple M2
    Memory: 110.89 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh

Additional context

@kimulaco kimulaco added the bug Something isn't working label Jan 2, 2025
@cexbrayat
Copy link
Member

Yes this has been fixed in #2511 but not yet released

@kimulaco
Copy link
Author

kimulaco commented Jan 2, 2025

@cexbrayat Thanks.
I misunderstood the order of adding peerDependencies and the previous release.

@kimulaco
Copy link
Author

@cexbrayat Is there any planned release date for the next version?

I'm experiencing this issue in my project. While I've temporarily worked around it using the pnpm workspace features, I'm looking forward to having this fix officially released 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants