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
webpack hangs in middle when '--p' is used always on 68% #2012
Comments
Maybe as a workaround you could get a non-minified output from Webpack and then pass it through Uglify separately. I know that's not neat but at least it would allow you to get ahead. Possibly related issue: #537. |
I am getting an non-minified file and then minifying with php but after this also its size is still 1MB |
Check out the bundle carefully. It's probably bringing things there you might want to include. Based on your setup it will inline CSS within the bundle. Consider setting up |
@bebraw after extracting css, build.js is reduce by 18kb so practically its still of 1MB. |
@S1E- Yeah. There is something else going on. Perhaps some of your vendor dependencies are heavy or it includes code you don't want it to. There are tools like Webpack Chart that can give you a better idea. |
Particularly materialize-css and crypto-js seem really big. You could try to analyze how you are using those. Maybe you just need a smaller subset of each. You can load a dependency like jquery as an external. There are also code splitting techniques you can leverage. To get back to the original issue, it would help a lot if you could set up a simplified test case that demonstrates the hang. Strip as much code as you can. This will make it easier to debug. |
Can you please suggest me to some resource? Where I can see that how I can I write a test to debug this issue. |
Essentially it would be about dropping as much material from your project while retaining the hang. At some point it will stop failing so you may need to step back. You can try eliminating entire pieces of the project like styling for instance. There isn't any specific resource as it's just generic debugging to pinpoint the cause. 👍 Hopefully this process helps you to understand what triggers the issue. |
I have already tried that, all the files included in the bundled are used somewhere so when I remove any one of them then webpack throws error 'required file not found' |
Yeah, you would have to perform the changes on code level on a separate branch. No other way. |
OK and thanks |
You could try the 2.0.7-beta version, which displays the module name in the progress thing. Maybe this helps to identify the point where it hangs.. |
I tried 2.0.7-beta but the message is similar, no mention of the module name. It was "additional asset processing" |
I'm seeing the same issue and not uglifying. Today I did an npm install, first time in about a week. So I think something changed recently to cause this. I consistently see this: 68% or 69% is the consistent mark with 119-121/123 built. |
Facing same issue, but I noticed one thing that it's not happening for Webpack |
Can you try against the current beta version of webpack 2? |
Hello, I have the same issue with webpack 2.2.0-rc.3 and webpack.2.1.0-beta.28 |
@clemgrim Could you set up a project so it's easier to debug what's going on? |
Here is my config: // load required modules
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
// load plugins
var CopyWebpackPlugin = require('copy-webpack-plugin');
var AssetsPlugin = require('assets-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var NgAnnotatePlugin = require('ng-annotate-webpack-plugin');
module.exports = function(options) {
return {
entry: {
home: '/some/path/home.ts', // there're more entries
vendor: '/some/path/vendor.ts')
},
output: {
path: '/some/path/dist',
filename: '[name].js',
chunkFilename: '[id].chunk.js',
publicPath: '/dist/',
jsonpFunction: 'jsp'
},
resolve: {
extensions: ['.ts', '.js'],
modules: ['/some/path', 'node_modules'],
unsafeCache: true
},
resolveLoader: {
moduleExtensions: ['-loader']
},
module: {
loaders: [
{
test: /\.ts$/,
loader: 'awesome-typescript',
exclude: [/node_modules/]
},
{
test: /\.html/,
loader: 'html',
exclude: [/node_modules/]
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({fallbackLoader: 'style', loader: options.prod ? 'css!postcss' : 'css'})
},
{
test: /\.scss/,
loader: ExtractTextPlugin.extract({fallbackLoader: 'style', loader: options.prod ? 'css!postcss!sass' : 'css!sass'})
}
],
noParse: [
/angular.*\.js$/,
/moment.*\.js$/,
/ui-select.*\.js$/,
/pdfjs-dist.*\.js$/,
/ngmap.*\.js$/,
/ng-file-upload.*\.js$/
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({names: ['vendor']}),
new ExtractTextPlugin(options.prod ? '[name]-[chunkhash].css' : '[name].css'),
new webpack.DefinePlugin({PRODUCTION: !!options.prod}),
new AssetsPlugin({filename: 'manifest.json', path: absPath('data/webpack')}),
new webpack.LoaderOptionsPlugin({
minimize: options.prod,
debug: false,
options: {
htmlLoader: {
ignoreCustomFragments: [/\{\{.*?}}/],
attrs: false
},
postcss: function () {
return options.prod ? [autoprefixer] : [];
}
}
}),
new NgAnnotatePlugin({add: true})
],
node: {
global: false,
crypto: false,
module: false,
clearImmediate: false,
setImmediate: false
},
devtool: false,
profile: true,
performance: {
hints: false
},
stats: 'verbose',
watchOptions: {
ignored: [
'./node_modules/**/*',
'./module/**/*',
'./public/**/*',
'./vendor/**/*'
]
}
};
}; It takes ~25s (I optimized from 35 to 25s with |
Same problem here, hangs on 91% additional asset processing |
Same here for us. |
Same for me, but on 66%. |
The weird thing for me is that, with the exact same versions of node, npm, yarn, and all of the packages, I can run this on my Macbook Pro (macOS 10.12.3 with 16 GB RAM and SSD) and it will finish in about 50 seconds. On my Ubuntu 16.04 servers (8GB RAM AWS with SSD), it takes 15 minutes (hanging at 68% for a long time but it does eventually finish). So I have to perform the build step on my mac and then rsync the files to the servers. Has anyone else experienced this where it will work on a Mac in a reasonable amount of time but it's dog slow on a Linux server with the same build tools? |
I am having the same issue. With the |
same issue here with node 8.4.0 |
Our production build is also failing after We cannot skip minification or tree-shaking, as this would yield an unwieldy large application that is quite slow to load. |
I found a workaround for usWe replaced all Comparison of old vs "fixed" solution
new "fixed" workaround
previous implementation
SummaryReplaced Adjust |
@urbanhusky icreasing the max memory does indeed fixed the hangs on 68-69%. thanks for that! |
For everyone experiencing the 91% hang, let's get #4558 reopened. There has been some discussion there, but the issue has been closed prematurely. |
I'm getting stuck at 70% with webpack 4.0.1:
|
@mnpenner can you create minimum reproducible test repo? |
@mnpenner Have you tried increasing your NodeJS memory limit? How big is your project? |
@evilebottnawi Uhh... we'll see. I'm going to fight with it a bit more first. My config is rather complex. @montogeek No, I haven't tried that. I should do something like this?
Same result. It's not crashing though, so it doesn't seem like it's running out of memory. My project has 514 "assets" -- I think all or most of those are processed by webpack. The part I find weird though is that it says "1691/1691 modules 0 active" -- as though it's done. It seems like its getting confused. I guess I'll wait for the v3 to v4 migration guide. Probably missed something. webpack-dev-server still runs, its just my production build that's hanging. |
@mnpenner try to enable/disable plugins and loaders |
@mnpenner I had the same problem and for me the cause was extract-text-webpack-plugin. Switching to mini-css-extract-plugin solved it. |
Thanks Jack. That worked for me too (switching to mini css)
On Mar 27, 2018 12:53 AM, "Jack Tomaszewski" <notifications@github.com> wrote:
@mnpenner <https://github.com/mnpenner> I had the same problem and for me
the cause was extract-text-webpack-plugin. Switching to
mini-css-extract-plugin solved it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2012 (comment)>,
or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABD7phI-EC4S-5jFvxm_G67PP8BUrK0Yks5tie_9gaJpZM4HU1aB>
.
|
FYI |
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
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
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
I had a similar issue, google pointed me here. Leaving my findings for the future. I resolved it by adding
It slowed down my linux builds, so I split it into two scripts. But it turned my windows builds from never-finishing always-hanging to actually-completes (in about 3.5 minutes) |
Thank you very much for this hint. webpack was hanging at the end of a run unless I set |
I am using vuejs Loader. When I run the command "production" === "webpack --p --progress". It always get struck at 68% and keeping stucking there forever. Can anyone suggest why is this happening and how can I resolve this.
this is my web.config.js
this is my package.json
The text was updated successfully, but these errors were encountered: