Closed endze1t closed 5 years ago
I think problem in uglify-js
, better use terser
plugin (https://github.com/webpack-contrib/terser-webpack-plugin), anyway can you create minimum reproducible test repo?
I wish i could deliver a reproducable, but this happens on a 3.5mb big output file. Not sure, on which component this happening. After uglifyjs file in webpack config the code is no longer readable.
I just tested it with terser
and this is working. I'll go with terser in future then, thanks for letting me know about this plugin.
@endbay maybe you comment/uncomment import
and require
to detect problem code for creating issue in uglify
Looks like the Webpack & React upgrades wasn't the issue. I figured out this came from latest i18next-react
@v10.0.0 (https://github.com/i18next/react-i18next). But this v10.0.0 is only for latest React version.
@endbay I have the same stack. Upgrade react, i18n-next... broken. Is there a solution?
@dcworldwide use terser-webpack-plugin
Thank you.
same issue i can see error comes from a line where a hook is called i.e. useEffect(() => {
are you recommending terser as a quick fix or are you indicating that this wont get fixed in this package ?
@ammanvedi uglify
looks like abandoned, so we recommend switch to terser
plugin, webpack@4 and webpack@5 by default use terser
. I close this issue, because we can't fix it on our side, sorry.
Solutions:
uglify
(feel free to send a PR to their repo)terser-webpack-plugin
Thanks!
After upgrading React (to v16.8.1, from v16.7.0) and Webpack (to v4.29.2, from v4.28.4) to latest version:
npm run build
is no longer working. Building works without errors, but frontend crash withUncaught TypeError: Cannot set property 'lastEffect' of null
.Builds are worked before together with
uglifyjs-webpack-plugin
. And with latest version withoutuglifyjs-webpack-plugin
as well.