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 Report]: RSPack has a peerDependency on Webpack #2318

Closed
iclanton opened this issue Mar 16, 2023 · 2 comments · Fixed by #2349
Closed

[Bug Report]: RSPack has a peerDependency on Webpack #2318

iclanton opened this issue Mar 16, 2023 · 2 comments · Fixed by #2349
Labels
bug Something isn't working on hold

Comments

@iclanton
Copy link

System Info

System:
OS: Windows 10 10.0.22623
CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
Memory: 35.40 GB / 63.84 GB
Binaries:
Node: 16.19.0 - ~\AppData\Local\nvs\default\node.EXE
Yarn: 1.22.19 - ~\AppData\Local\nvs\default\yarn.CMD
npm: 8.19.3 - ~\AppData\Local\nvs\default\npm.CMD
Browsers:
Chrome: 111.0.5563.65
Edge: Spartan (44.22621.1325.0), Chromium (109.0.1518.61), ChromiumDev (107.0.1387.2)
Internet Explorer: 11.0.22621.1
npmPackages:
@rspack/cli: ^0.1.1 => 0.1.1

This information doesn't matter for this issue.

Details

When installing @rspack/cli in a repo backed by pnpm with strict peer dependencies enabled, you get this error:

../../heft-plugins/heft-rspack-plugin # This is an arbitrary package path
└─┬ @rspack/cli 0.1.1
  └─┬ @rspack/dev-server 0.1.1
    ├─┬ webpack-dev-server 4.11.1
    │ ├── ✕ missing peer webpack@"^4.37.0 || ^5.0.0"
    │ └─┬ webpack-dev-middleware 5.3.3
    │   └── ✕ missing peer webpack@"^4.0.0 || ^5.0.0"
    └─┬ @rspack/dev-middleware 0.1.1
      └─┬ webpack-dev-middleware 6.0.0
        └── ✕ missing peer webpack@^5.0.0
Peer dependencies that should be installed:
  webpack@">=5.0.0 <6.0.0"

@rspack/dev-server has a dependency on webpack-dev-server and @rspack/dev-middleware has a dependency on webpack-dev-middleware which both have peerDependencies on webpack.

Reproduce link

No response

Reproduce Steps

In an empty folder, run:

  1. pnpm init
  2. pnpm install @rspack/cli --save --strict-peer-dependencies
@iclanton iclanton added the bug Something isn't working label Mar 16, 2023
@octogonz
Copy link

@hardfist maybe this is by design?

@hardfist
Copy link
Contributor

yes this is by design right now, since we reuse lots of webpack related packages right now to avoid incompatible with webpack, I am wondering whether webpack-dev-middleware could list webpack as optionalPeerDependency other than peerDependency which could solve this problem.

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

Successfully merging a pull request may close this issue.

3 participants