webpack: will hang on "95% emit(ting)" if `output.path` contains reserved characters

From those coming from Google

It seems that hanging on “95%” is a symptom from many different issues. If there is an uncaught problem at a certain point in your build, webpack will just get stuck here. It doesn’t mean it is because of reserved characters for you (although it might be). The comments in this thread may help you debug your own issue. Godspeed!

I’m submitting a feature request

Webpack version: 1.10.x & 2.x

Please tell us about your environment: Windows 10

Current behavior:

When using an invalid or reserved character in the output.path webpack will hang with no output. Running with the --progress flag will show that it’s hanging on 95% emit(ting) (suffix depending on webpack version).

Webpack 1.13.2: hangs on 95% emit Webpack v2.1.0-beta.21: hangs on 95% emitting

Expected/desired behavior:

Perhaps throw an error if output.path contains reserved characters?

What is the motivation / use case for changing the behavior?

To save debugging time for future people who try to use reserved characters names in the output path 😂

I’m happy to set up a PR on this if need be, I just wanted to make it known here… perhaps there’s a reason to this.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 19
  • Comments: 29 (1 by maintainers)

Most upvoted comments

I’m getting this problem but I don’t think my path has reserved characters.

Hi for me the issue is the [path] placeholder in file-loader. It uses context so you have to define plugins: [ new webpack.LoaderOptionsPlugin({ options: { context: __dirname}}) ] for it to work. Alternatively, you can remove [path] if your location is already __dirname. Also try using “./” instead of __dirname.

rm -rf node_modules rm package-lock.json npm i Works for me. I had upgrade webpack-dev-server and met this problem. No code had changed, but still hang up. I guess that node processes is conflict in not compatible packages.

@rainice fixed my issue too. I was using the ExtractTextPlugin. I had to change this:

new ExtractTextPlugin({
  filename  : path.resolve(__dirname, 'dist/[name].bundle.css'),
  allChunks : true
})

to

new ExtractTextPlugin({
  filename  : './dist/[name].bundle.css'),
  allChunks : true
})

Hey guys, I was stuck with this problem for a few hours now, tried everything I found posted here and elsewhere (node-sass issues, file-loader issues).

What eventually solved it for me was removing noInfo option from my dev config. Not really sure why, what it changes internally, but maybe it will help someone else… 😃