You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running yarn rspack --mode production build gave me:
Error: @rspack/plugin-react-refresh tried to access react-refresh (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
I solved the problem adding the following to yarnrc.yml:
Just realized Yarn PnP is not supported #2236 and I was using Yarn PnP, but i decided to switch to Yarn pnpm because rspack is so darn fast compared to webpack.
Regarding this issue, @rspack/plugin-react-refresh tries to access react-refresh and fails even with Yarn pnpm.
System Info
System:
OS: Windows 10 10.0.22621
CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
Memory: 5.66 GB / 15.95 GB
Binaries:
Node: 20.4.0 - C:\Program Files\nodejs\node.EXE
Yarn: 3.6.1 - C:\Program Files\nodejs\yarn.CMD
npm: 9.7.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22621.2283.0), Chromium (117.0.2045.47)
Internet Explorer: 11.0.22621.1
Details
Running
yarn rspack --mode production build
gave me:I solved the problem adding the following to
yarnrc.yml
:Please consider making
react-refresh
a dependency of@rspack/plugin-react-refresh
and not a peer dependency.Reproduce link
No response
Reproduce Steps
yarn install @rspack/cli
rspack.config.js
yarn rspack --mode production build
The text was updated successfully, but these errors were encountered: