laravel-mix: `mix.extract()` causing the resources processing to freeze with `95% emitting` message

  • Laravel Mix Version: 1.0.3 (npm list --depth=0)
  • Node Version (node -v): 6.10.3
  • NPM Version (npm -v): 5.0.3
  • OS: Windows 8.1
npm list --depth=0

+-- axios@0.15.3
+-- bootstrap-sass@3.3.7
+-- cross-env@3.2.4
+-- jquery@3.2.1
+-- laravel-mix@1.0.3
+-- lodash@4.17.4
`-- vue@2.3.4

npm ERR! peer dep missing: webpack@^2.2.0, required by extract-text-webpack-plugin@2.1.2
npm ERR! peer dep missing: webpack@^2.2.0, required by webpack-dev-server@2.5.0

Description:

Hi artisans,

Can anybody confirm this (Especially on Windows) or am i the only one who have this issue !!

Steps To Reproduce:

Start with a new laravel installation

Edit the webpack.mix.js file like this

const { mix } = require('laravel-mix');

mix.sass('resources/assets/sass/front/app.scss', 'public/css')
   .sass('resources/assets/sass/back/admin.scss', 'public/css')
   .options({
       processCssUrls: false,
   });

mix.autoload({
    jquery: ['$', 'window.jQuery', 'jQuery']
});

mix.js('resources/assets/js/app.js', 'public/js');

mix.extract([
    'axios', 'vue', 'jquery', 'bootstrap-sass',
], '/assets/js/vendors.js');

After that run: npm run dev

λ npm run dev

> @ dev d:\...\test-mix
> npm run development

npm WARN invalid config loglevel="notice"

> @ development d:\...\test-mix
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

 95% emitting

And if you comment the mix.extract([...], '/assets/js/vendors.js');, the build pass !!

Also, i want to point something weird with mix-manifest.json:

{
    "/d:/assets/js/vendors.js": "/d:/assets/js/vendors.js",
    "/js/app.js": "/js/app.js",
    "/css/app.css": "/css/app.css",
    "/css/admin.css": "/css/admin.css",
    "/js/manifest.js": "/js/manifest.js"
}

I think the first line "/d:/assets/js/vendors.js": "/d:/assets/js/vendors.js", is invalid because it starts with /d:/assets !!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

I use Laravel Mix also for non-Laravel projects where is no artisan file which, apparently, is being used by Laravel Mix to detect Laravel (in which case publicPath is being set to public automatically). I was struggling with this issue after upgrading from version 0.8.8 to version 1.0.7 until I found out what was the cause of that 95% emitting message.

So, yes, @PascaleBeier is [almost] right, you should set publicPath like this:

mix
.options({
    publicPath: 'public'
})

@arcanedev-maroc

mix.setPublicPath('./'); solves this for me - can you confirm?

Can someone please test this again? It is failing on my windows 10 system as well.

OMG @taai, you’re a lifesaver 🙌

I’ve changed the code to this and it WORKS!!!

const { mix } = require('laravel-mix');

mix.options({
    processCssUrls: false,
    publicPath: 'public'
});

mix.sass('resources/assets/sass/app.scss', 'public/assets/css');

mix.autoload({
    jquery: ['$', 'window.jQuery', 'jQuery']
});

mix.js('resources/assets/js/app.js', 'public/assets/js');

mix.extract([
    'axios', 'vue', 'jquery', 'bootstrap-sass',
], 'public/assets/js/vendors.js');

@JeffreyWay, i don’t know if it’s a bug or an attendant behavior. But it’s definitely a breaking change (Or only for Windows users ?) when you upgrade from laravel-mix 0.x to 1.x.