-
-
Notifications
You must be signed in to change notification settings - Fork 873
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
With Razzle 4, I can't just use Webpack 5 #1662
Comments
Npm 7? Because razzle does not support that yet. Need to split razzle into a wp4 and wp5 version first since npm 7 has stricter deps. |
No,
And I'm guessing it probably makes sense to make the |
Thank you @heath-freenome , I had to apply the very same changes like you described them, to solve the issues. lifesaver! |
馃悰 Bug report
Current Behavior
According to the documentation I can just pick webpack 5 and things will work... only when I do
razzle build
produces a TON of errors when I turn ondebug: { compile: true }
and my code fails to run.I'm guessing that I need to update a lot more than just the two packages indicated (webpack@5.24.0 html-webpack-plugin@5.2.0). First when running the command, I see the following warnings:
I see resolve problems like (webpack can be configured to avoid this as noted in this documentation fix):
I also see errors from terser.js like the following (Webpack 5 comes with it out-of-the-box) so it can be removed from the
optimizations.minimizer
array):And also errors like this (which can be fixed using the node-polyfill-webpack-plugin):
Expected behavior
I follow the directions for using webpack 5 and it works
Reproducible example
Suggested solution(s)
Here's how I worked around them in my custom
razzle.config.js
First the resolve issue:
Second the Terser issue:
Third the polyfill issue:
UPDATE: The following original solution broke my apps ability to get process environment variables because too much was polyfilled...
INSTEAD, I went with the solution actually spelled out in the error message (doh):
This required me to
npm install buffer
instead of thenode-polyfill-webpack-plugin
Additional context
Even just running the npm version of the command documented tells me something is wrong given the number warnings related to webpack:
Your environment
The text was updated successfully, but these errors were encountered: