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 not work #3671

Closed
hellobq opened this issue Oct 10, 2024 · 6 comments
Closed

[Bug]: peerDependencies not work #3671

hellobq opened this issue Oct 10, 2024 · 6 comments
Labels
🐞 bug Something isn't working need reproduction

Comments

@hellobq
Copy link

hellobq commented Oct 10, 2024

Version

Mac m1
chrome lastest
@rsbuild/[email protected]

Details

Package-B used in project-A (imported through the file protocol ), react is introduced in package-B through peerDependencies, and an error ×Module not found: Can't resolve 'react' ... will be reported in the development environment

Reproduce link

no

Reproduce Steps

use npx create-rsbuild --dir my-project --template react create project-A
then use package-B(peerDependencies include react)
then npm run dev
then throw error...

@hellobq hellobq added the 🐞 bug Something isn't working label Oct 10, 2024
@SoonIter
Copy link
Member

This problem seems to have nothing to do with rsbuild, but with pnpm.
Please provide a minimum reproduction repo.

Copy link
Contributor

Hello @hellobq. Please provide a reproduction repository or online demo. For background, see Why reproductions are required. Thanks ❤️

@SoonIter
Copy link
Member

this problem seems very common in monorepo and soft-link (ln -s) and it is a known problem

...However, it has nothing to do with rsbuild

@hellobq
Copy link
Author

hellobq commented Oct 10, 2024

This problem seems to have nothing to do with rsbuild, but with pnpm. Please provide a minimum reproduction repo.

no, i installed the dependencies locally using npm not pnpm. 😊 But webpack can handle this scenario...

@hellobq
Copy link
Author

hellobq commented Oct 10, 2024

Hello @hellobq. Please provide a reproduction repository or online demo. For background, see Why reproductions are required. Thanks ❤️

https://github.com/hellobq/rsbuild-lib

@hellobq
Copy link
Author

hellobq commented Oct 11, 2024

I tried it and the problem can be solved through the git protocol. now you can close this issue. Thank you. ❤️

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

No branches or pull requests

3 participants