-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
large webpack build almost hangs at 91% on an "additional asset processing" step #4558
Comments
duplicate of #4550 |
@sokra It looks very similar but in my case, the upgrade to 2.3.1 actually improved the performance by about 10%. The performance actually started to slow down when migrating from webpack1 to 2. Is there anything I can do to track down where the time is lost to eventually help? |
At the latest v2.3.3 update wrote that
But I still have the same problem. |
I upgrade to latest webpack due to this issue, but still same it usually takes around 10 minutes for dist build and most of this time is haning on 91% additional asset processing |
I also have this problem for production builds |
Happens for me only when using |
It hangs on each large file at 91%. It takes a lot of time and finally provides the error message: Not enough memory. Hardly to use. |
I found a solution. Simple add more memory for running with --max-old-space-size param |
Thanks for the answer! But that does not solve the problem that you have to wait on a fast computer over 10 minutes with 25% CPU usage and over 1 GB of memory each time to the completion. That is to long! |
@leyyinad I have the same issue. Mine takes about 4minutes at 91% with babili-webpack-plugin enabled. |
See here: babel/minify#332 |
I already tried that. It fixes the initial issue of the build failing to complete, but the issue with being stuck at 91% processing still remains. |
Its probably UglifyJSPlugin or UglifyJsParallelPlugin. Try commenting that out and see if that makes things faster. |
My team's project always hangs on 91% and then sits for a bit on 92%, but removing UglifyJSPlugin fixed the 91% hang. |
@EthanStandel I can also confirm that I just removed the UglifyJSPlugin and it fixed the 91% hang in my project |
I originally opened this SR and can also confirm, that there have been a few minor (~10%) performance improvements in webpack but most of the time is still consumed in the UglifyJSPlugin. In my current environment webpack does not actually hang but the |
Don't rely on Webpack plugins for everything e.g. we are using this in Go and its WAAAY faster: https://github.com/tdewolff/minify with maybe slightly less optimisations. |
I have this issue too. Finally found out that webpack 3.5.5 and Extract text plugin 3.0.0 combo will cause this problem. Each incremental dev build will take about 20 seconds which is unacceptable. |
Why was this closed? I'm still having this issue after trying several different workarounds posted. I'm still seeing a lot of people commenting on various threads that are experiencing the same thing. The only way I can resolve is setting the webpack devtool to 'eval', but that's not supposed to be used for production. |
I hate to +1 this, but I have been working around this problem for a long time, and I can probably provide more info: The only way acceptable way I can get my builds to succeed is to use https://github.com/gdborton/webpack-parallel-uglify-plugin and ensure it uses UglifyJS instead of UglifyES. If I set that plugin into UglifyES mode it will hang at 91% just as the main webpack uglify plugin. Builds also succeed if I've tracked this down to Now the question is why does Could this be reopened? I've been using webpack 2 while struggling with this, have just now upgraded my entire setup to |
I've been debugging this issue and found out it is probably a bug in UglifyJS, see: mishoo/UglifyJS#2609 I'm able to avoid the 91% hang by passing new UglifyJSPlugin({
parallel: true,
uglifyOptions: {
ecma: 6,
compress: false // hangs without this
},
cache: path.join(__dirname, 'webpack-cache/uglify-cache'),
}) |
Having this same problem. Our devtool option is set to inline-cheap-module-source-map. Disabling UglifyJsPlugin does the trick, build passes. Funnily enough, so does setting devtool to eval. Even funnier, unsetting devtool does not fix the problem. What?! EDIT: Using version 1.1.5 of uglifyjs-webpack-plugin EDIT2: Updating uglify-webpack-plugin to latest (1.2.2), adding uglifyOptions for |
I seem to be having the same issue on Webpack 4 no matter which plugin I'm using, UglifyJS, babel-minify etc, they all hang at |
I experienced the same error on
|
my webpack version:@2.7.0 . |
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100
Hi! I am just set regExp for files extension, that I want to uglify
This works for me. And what I found that, every next webpack build will be built much faster than previous. First my try was about 12 minutes, 6th try was about 2 minutes with the same configuration. |
91% additional asset processing scripts-webpack-plugin× 「wdm」: Error: ENOENT: no such file or directory, open 'C:\Users\chand\node_modules\jquery\dist\jquery.min.js' |
Same issue: |
I have fixed this issue by removing the 'new webpack.optimize.UglifyJsPlugin({sourceMap: true}),' |
I originally opened this SR and for me the solution was to always use the latest webpack version and invoke node with the --max_old_space_size=4096 option. This permanently solved the problem for me! |
The latest version of the angular devkit package (0.13.6) with the latest version of the webpack-env package (1.13.9) seems to have solved this problem. |
Same problem when I deploy on server. In my case, I just fix it by increasing the swap ram area.
|
Below settings helped me to reduce the heap memory since it will not include the sourceMap file.
or below code will help for latest webpack uglify plugin.
If this still not help to fix the problem. below command helps to increase heap memory and answer link to know more about heap memory is below as well.
|
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100 Signed-off-by: Lee Porte <lee.porte@digital.cabinet-office.gov.uk>
We still don't know why the build of tdp_publicdb (and only this repo) takes more than 15 min (instead of 2.5 min) after merging PR #65 into develop branch. We debugged the build a long time and found only the following work around by adding specific configuration to the UglifyJsPlugin, which disabled the check for unused code. This reduces the (local) build time again to about 2.5 min. Further resources: * webpack/webpack#4558 * https://github.com/webpack-contrib/uglifyjs-webpack-plugin
I met the same case, you can try this statement in terminal: npm i |
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100 Signed-off-by: Lee Porte <lee.porte@digital.cabinet-office.gov.uk>
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100 Signed-off-by: Lee Porte <lee.porte@digital.cabinet-office.gov.uk>
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100 Signed-off-by: Lee Porte <lee.porte@digital.cabinet-office.gov.uk>
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100 Signed-off-by: Lee Porte <lee.porte@digital.cabinet-office.gov.uk>
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100 Signed-off-by: Lee Porte <lee.porte@digital.cabinet-office.gov.uk>
Staging was hanging indefinitely when it started optimizing assets (part of the `npm run build` postinstall script). I didn't investigate fully, but it seems to be related to Node's poor grasp of system resources[1,2,3]. One suspect was identified in the build output: ``` > npm run build (node:46) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit ``` [1] webpack/webpack#2012 (comment) [2] webpack/webpack#4558 [3] webpack-contrib/sass-loader#100
Do you want to request a feature or report a bug?
possible bug
I have already asked on StackOverflow and it seems as if this behavior would be quite common but there have been no possible solutions.
What is the current behavior?
I have a large webpack build that almost hangs at 91% on an "additional asset processing" step.
To complete processing take about 8 minutes but the step "additional asset processing" consumes at lwat half of the time.
Webpack does not give me a lot more information and I would like to better understand if this is "normal", a bug or what can be done to eventually optimize my build?
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
faster or more information on what is currently being done
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
node: 6.10.0
webpack: 2.3.1
OS: Windows 7 x64
The text was updated successfully, but these errors were encountered: