-
-
Notifications
You must be signed in to change notification settings - Fork 179
Production build hangs at 92% #272
Comments
Well, I post the config in case there is an error on it - if you don't spot an error I can create a repo that reproduces the error, Thanks in advance 😊 |
Instead of using the build-in module from webpack, when actually use the plugin on my |
Still experimenting... Using Using https://github.com/pingyuanChen/webpack-uglify-js-plugin works on |
@melloc01 can you create minimum reproducible test repo? |
@melloc01 Friendly ping 👍 |
Thanks @evilebottnawi Will save some time on the weekend to set up the repo News: someone on Gitter is having the same issue |
Same here, and I get out of memory error after a while:
This error happens to me every time I tried to use My dependencies:
|
@zlk89 do you use latest version? |
@zlk89 Also please create new issue, your problem is other |
I just upgraded to webpack 4 ( |
@erickwilder Can you crete minimum reproducible test repo? |
My issue was apparently caused by the I did solve it by moving uglify from the
Unfortunately this was the work of some digging through the code and other people's setup - I didn't find clear documentation about it. |
@erickwilder in |
@evilebottnawi actually, if you specify the I actually set up a dummy repo that mimics the file structure (w/ dummy modules) of the original project but unfortunately it didn't hang, so it's not reproducible using dummy modules I'm up for a call if you wanna dig into it @evilebottnawi, it's private so I can't just put on gh =\ |
@melloc01 can you add coded in uglify plugin here https://github.com/webpack-contrib/uglifyjs-webpack-plugin/blob/master/src/index.js#L184
|
sure - done it. I'm using exactly this source: Output:
|
@melloc01 very intresting, you always have zero tasks 😕 You enable parallel? If yes, can you disable and check again? If no can you enable and check again? 😄 |
Anything else than the filename to help debugging @evilebottnawi? |
After a while: Same thing with
|
Config:
|
@melloc01 can you idntify after what file it is happens? Just add console.log(file); here https://github.com/webpack-contrib/uglifyjs-webpack-plugin/blob/master/src/index.js#L184. Also add console.log(this.maxConcurrentWorkers) here https://github.com/webpack-contrib/uglifyjs-webpack-plugin/blob/master/src/uglify/index.js#L19. Thanks for help! |
I'm back... debugging:
|
Btw, I updated the gist. Look for |
@melloc01 can you rewrite https://github.com/webpack-contrib/uglifyjs-webpack-plugin/blob/master/src/uglify/worker.js#L3 module.exports = (options, callback) => {
try {
// 'use strict' => this === undefined (Clean Scope)
// Safer for possible security issues, albeit not critical at all here
// eslint-disable-next-line no-new-func, no-param-reassign
options = new Function(`'use strict'\nreturn ${options}`)();
const minified = minify(options);
callback(minified.error ? 'Error' : null, minified);
} catch (errors) {
callback(errors);
}
}; And run in parallels mode? |
@evilebottnawi sorry about that last comment, it wasn't right. Actually, I am modifying the babelified version of the plugin, so on babelified version it is |
@melloc01 yep, rewrite using |
Same outcome - stuck at 92% until core dump I also logged the |
@melloc01 can you disable |
It seems that it is getting stuck in somewhere else @evilebottnawi ... I changed the worker code to this:
and the output:
It's stuck consuming memory right now |
Same issue? |
Getting the same issue on the latest Angular version. My build has been hanging for almost 10 minutes now... |
We're seeing this issue too - we've narrowed it down to source maps being the issue in our case. We have a lot of code (if I run Webpack without minifcation it produces some 600MB of JS) however if we turn on I've found a few things that could be potential areas for improvement:
I am still experimenting with improvements locally, to see whether there is actually significant impact, but wondering what the appetite for these kinds of changes would be? |
After investigating this more it's not as easy as it seems - within Unfortunately, I don't think there's much that can be done with the current architecture to alleviate the memory pressure - I believe there's more significant architectural changes planned for Webpack 5 that'll move more caching to disk. In the meantime I've had a bit more success with using the I didn't get around to trying parallelising source map generation. Important to note that all these results are running a custom fork of |
@marcins I followed your suggestion and opened an issue to backport the performance fix to 0.6 (mozilla/source-map#370) |
I've noticed that this will manifest if there is a discrepancy between a slick table definition and the case class that represents the row. In my case it was a column defined as a Option[String] while the case class attribute was an Option[Long]. |
I had the same problem. |
The problem is that Uglify does not say that it loops on a regex. |
Does anyone know if this issue got fixed. We're still experiencing it. |
@sumantka unfortunately we couldn't get this fixed on the main uglify branch, but the community has decided to fork uglify and make a new minifier called terser. It should be identical except terser is more optimized and effecient. If you look at webpack docs they even only recommend the terser plugin. There should be no work switching other then actually using a different loader and plugin because again this was a fork of uglify |
Thanks @mlavina Unfortunately that doesn't seem to be the issue, or atleast that's what it looks like. It seems webpack by default adds some plugins in prod mode, terser is one. Now it seems to be failing at that. So not sure if it's inherently a problem of terser or some other plugin. Thanks for the context though |
@sumantka after I switched to Terser I didn't experience the issue anymore, check if you're not forcing uglifyjs as a minifier on your config maybe? Otherwise I think you should open an issue on the Terser repo. |
Temp solution, just to make it work (without minifying): Setting const TerserPlugin = require('terser-webpack-plugin');
optimization: {
minimizer: [
new TerserPlugin({
chunkFilter: () => false, // <-- set to false
}),
],
}, |
I'm pretty sure that turns off minifying altogether. From the main readme of the repo:
I'm 99% sure that 'uglified' and 'uglify' in this context means 'apply the plugin to minify the code of the chunk'. I doubt you want to turn off minifying completely, @knapcio? |
Problem inside uglifyjs, they have problem(s) in code where you get infinity loop and webpack is freeze, no workaround for this plugin, please use terser-webpack-plugin |
I came to this thread because I am experiencing the issue after having just migrated from Webpack v2 to v4, but not using Uglify at all. Just using the default minimizer. |
@papiro do you use WSL? |
Hello,
I think this is probably a bug with this plugin since the dev build works fine and when I run
webpack --progress
it gets stuck in:92% chunk asset optimization UglifyJSPlugin
Below, the relevant parts of my webpack.config:
Is this enough info? I tried to run with
--debug --progress --display-error-details --verbose
but nothing else came outThe text was updated successfully, but these errors were encountered: