-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Failed to minify the bundle" error on build (related to Terser) #6334
Comments
Also reproducible with |
|
|
Works for now! |
@romannep -- Thanks! That did the trick for me as well. |
That’s not helping with
The newer version will be used, of course. Instead, you have to add a "resolutions": {
"terser": "3.14.1"
} Also, here’s the error message as a searchable text:
|
fuzzykiller's fix also works. Looks like CRA needs to solve it's issues with terser |
|
|
Now I am facing trouble to get the terser fix work inside docker.
And I get the same terser error:
How do I resolve this? |
The app builds successfully with More specifically: "node": "11.5.0",
"npm": "6.7.0" However, I get the same error i.e. More specifically: "node": "10.10.0",
"npm": "6.4.1" or: "node": "10.15.1",
"npm": "6.4.1" The Node LTS is currently Note:As mentioned before by @romannep, installing $ npm install terser@3.14.1 --save-dev
$ npm run build |
Build process failing even after |
@Infi-Knight - I'm having the same issue inside a docker container too. And none of these solutions seem to be working for me. |
Hi all, thanks for raising this. I'd recommend using |
@vx-lp - are you using Yarn in the docker container? And you've updated your |
@Infi-Knight @vx-lp This worked for me when building React app inside a Docker image:
As a step in Dockerfile:
No need to include terser in |
@RaMdsC thanks, your fix works |
Same bug on ubuntu. Installed lastest version of node an npm, but it keep failing when try to build on heroku server. Working locally. Can we expect the issue be fix in a further patch since the current solution is not really idealistic? |
@mrmckeb
|
I have pinged the team at Terser, as the fastest fix is them releasing a patch. This seems to be affecting other projects too, judging by the issues against Terser. I've also pinged the more senior members of our team, as I don't have the access levels to do anything from our end. |
how to fix in case of heroku postbuild with a subreact architecture and exclusively npm ok i fix how to do it. We have to change the script just for this case:
` Running heroku-postbuild
added 1881 packages from 783 contributors and audited 36953 packages in 71.252s
Creating an optimized production build... |
To fix this for my yarn-based build I needed to:
I am more than a little hesitant to add tracking this to my plate to unwind later, but this was a blocker for pushing my latest patch :/ |
Workaround for facebook/create-react-app#6334 Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Workaround for facebook/create-react-app#6334
Workaround for facebook/create-react-app#6334
Hi all, this should be resolved now by this release: Please report back if that doesn't help. |
Hm, I'm missing something here. I had a package-lock.json where the terser version was 3.14.1. I thought that package-lock existed exactly to ensure reproducible builds... Any idea why terser 3.16 was installed for me when running Now it seems that it have rolled back to 3.14.1, but I'm pretty sure I tested it this Monday and couldn't build because of it. |
@lindhe This looks to me like terser-webpack-plugin pulls terser as its own dependency if you specify terser in devDependencies, as suggested in answers above.
In (1), terser@3.16.1 gets installed as an independent package. You can further observe this with the existence of My guess is dependency gets prioritized over independent package. |
Thank you @RaMdsC, your response helped me gain a bit better understanding. But I'm still a bit in the unclear as to why package-lock.json was not enough. Sure, I can explicitly add I've heard about shrinkwrap. Is this where that comes in? Not that I understand what use package-lock.json is, but maybe shrinkwrap actually can guarantee reproducible builds? |
@lindhe |
What a pity. I'm at npm version 3.10.10 and that seems to not have the |
Is this a bug report?
yes
Did you try recovering your dependencies?
yes, npm version 6.4.1
Environment
Mac and windows
and
Steps to Reproduce
npx create-react-app hey
cd hey
npm run build
Expected Behavior
Production build should be built
Actual Behavior
The text was updated successfully, but these errors were encountered: