question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UglifyJsPlugin hangs on module building.

See original GitHub issue

When building my application with webpack.optimize.UglifyJsPlugin({}) webpack consistently hangs at around 53% 267/366 build modules. This seamed strange as I would expect it to hang at the optimising chunks stage (if at all).

When I comment https://github.com/webpack/webpack/blob/master/lib/optimize/UglifyJsPlugin.js#L139 I get a successful build. Oddly enough the sources seem to have been both mangled and minified.

Sadly I’m finding it hard to extract any debug information to move any further with this. Is there somewhere in the source I can add some logs to get a better idea of which module in my stack is causing the issue? I’ve tried context.resource but deleting the code in the offending module doesn’t seem to effect the issue at all.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
lazabogdancommented, Dec 18, 2015

+1 … just lost 6hrs of my life tracking down a similar issue caused by a loader when using webpack -p. The build was just stalling at “build modules” and no error, no timeout, no nothing. Just lovely time tracking it down in a serious dependency tree.

1reaction
jamespamplincommented, Aug 5, 2015

Hi, found the issue that was causing this problem for us. It was a bad HTML template breaking the html-loader / html-minifier. A badly closed quote " in the source, was breaking things. Switching to raw loader worked, allowing me to narrow in on the issue.

When you enable UglifyJsPlugin, it also activates minification in all loaders that support minification (context.minimize). So if you have similar issues when you enable UglifyJsPlugin, or use -p on the CLI, then I suggest you look at potential issues with all your loaders.

I suggest that webpack should implement a timeout for each compiler process so that it can catch hanging plugins, and error accordingly. Ideally, webpack should’ve errored with a timeout such as:

html-loader timed out after 10s processing file: src/templates/bad-template.html 
Read more comments on GitHub >

github_iconTop Results From Across the Web

Production build hangs at 92% · Issue #272 · webpack-contrib ...
This error happens to me every time I tried to use UglifyJSPlugin . My dependencies: { "autodll-webpack-plugin": ">=0.3.9", "autoprefixer": "> ...
Read more >
UglifyJSPlugin Out of memeory error while building
I have an angular 6 application I need to build I get the following error when I run. There a way to increase...
Read more >
How to boost the speed of your webpack build?
A story of performance optimization and application of the Pareto principle for a webpack build that has become far too long.
Read more >
How I solved and debugged my Webpack issue through trial ...
When webpack bundles your source code, it can become difficult to track down errors and warnings to their original location.
Read more >
Tree-Shaking | Font Awesome Docs
For instance, when running a production build with Webpack 4, it might seem to hang for a long time with a status of:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found