Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webpack hangs at on "95% emit" / "95% emitting"

This is my production webpack config. The two quotes in the title refer to webpack2 and webpack respectively. Both hang for me with a similar error.

This is my command to trigger the build

set NODE_ENV=production && webpack --config config/webpack.config.prod.js --progress --display-error-details

What am I missing?

Here is the output after running npm run pack which correlates to my production webpack build:

$ npm run pack

> somedir@ pack C:\somedir
> set NODE_ENV=production && webpack --config config/webpack.config.prod.js --progress --display-error-details
                           95% emitting
like image 214
bitten Avatar asked Aug 22 '16 17:08

bitten


2 Answers

So I figured this out. It turns out I was including reserved characters in my output path. I've since opened an issue on github.

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).

like image 55
bitten Avatar answered Oct 18 '22 04:10

bitten


In my case (Windows environment and laravel-mix) there weren't any incorrect characters in the path, since even a dead simple configuration didn't work. It was just webpack ([email protected]) doing something stupid of his own and the problem has been solved using publicPath option like this:

mix.options({
    publicPath: ('./')
});

which according to the documentation:

allows you to specify the base path for all the assets within your application

Alternatively you can use:

mix.setPublicPath('./');
like image 4
Picard Avatar answered Oct 18 '22 06:10

Picard