razzle icon indicating copy to clipboard operation
razzle copied to clipboard

Unable to install with webpack 5 and current npm LTS

Open max-degterev opened this issue 2 years ago • 3 comments

🐛 Bug report

Attempting to install dependencies with webpack 5 fails due to erroneous version lock inside razzle config:

npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/mini-css-extract-plugin
npm ERR!   mini-css-extract-plugin@"^2.4.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer mini-css-extract-plugin@">=0.9.0 <1.0.0" from [email protected]
npm ERR! node_modules/razzle
npm ERR!   razzle@"^4.2.6" from the root project
npm ERR!

Current Behavior

Install fails

Expected behavior

Install doesn't fail

Reproducible example

  1. update packages in package.json to latest version
  2. npm install

Suggested solution(s)

Make mini-css-extract-plugin an optional dependency or update to webpack 5 compatible version.

Your environment

Software Version(s)
Razzle 4.2.6
Razzle Plugins none
Node 16.13.0
Browser n/a
npm/Yarn npm 8.1.0
Operating System mac
TypeScript no
React 17.0.2

max-degterev avatar Nov 24 '21 14:11 max-degterev

If you use yarn you can force it with resolutions. Not sure we can switch to the new version yet due to esm.

fivethreeo avatar Nov 24 '21 14:11 fivethreeo

eh yeah or npm install --force, but that's not ideal so I'm stuck with webpack@4 for now. any idea when you will drop old webpack? It's been more than a year since v5 release.

max-degterev avatar Nov 24 '21 16:11 max-degterev

all depends on when https://github.com/jaredpalmer/razzle/tree/alpha is done

fivethreeo avatar Nov 24 '21 17:11 fivethreeo