Open heath-freenome opened 3 years ago
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.
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, 6.14.11
I kind of figured out how to work around all of those issues as I've mentioned above although I'm still seeing one deprecation warning:
(node:16842) [DEP_WEBPACK_EXTERNALS_FUNCTION_PARAMETERS] DeprecationWarning: The externals-function should be defined like ({context, request}, cb) => { ... }
And I'm guessing it probably makes sense to make the file-loader
, url-loader
and webpackbar
be peer-deps so that razzle doesn't lock them down to webpack 4 versions
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