question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Laravel Mix error with processCssUrls:true

See original GitHub issue
  • Laravel Mix Version: 0.11.4 (npm list --depth=0)
  • Node Version (node -v): 7.10.0
  • NPM Version (npm -v): 4.5.0
  • OS: Homestead on Vagrant with VBox on Windows 10

Description:

I am having an error when I try to run npm run dev with processCssUrls set to true (default). I keep getting:

 error  in ./resources/assets/less/admin/images/error-bg.jpg

Module build failed: Error: spawn /home/vagrant/Code/kin-ball-v4/node_modules/mozjpeg/vendor/cjpeg ENOENT
    at exports._errnoException (util.js:1050:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:367:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

 @ ./~/css-loader?{"url":true,"sourceMap":false}!./~/postcss-loader?{"sourceMap":false}!./~/less-loader?{}!./resources/assets/less/admin/style.less 5:80838-80870
 @ ./resources/assets/less/admin/style.less
 @ multi ./~/laravel-mix/src/mock-entry.js ./resources/assets/less/admin/style.less

Module build failed: Error: spawn /home/vagrant/Code/kin-ball-v4/node_modules/optipng-bin/vendor/optipng ENOENT
    at exports._errnoException (util.js:1050:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:367:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

 @ ./~/css-loader?{"url":true,"sourceMap":false}!./~/postcss-loader?{"sourceMap":false}!./~/less-loader?{}!./resources/assets/less/admin/style.less 5:106624-106660
 @ ./resources/assets/less/admin/style.less
 @ multi ./~/laravel-mix/src/mock-entry.js ./resources/assets/less/admin/style.less

I tried disabling it and it was able to build just fine… I am compiling less files btw.

Steps To Reproduce:

I am not sure, I followed the installation process… I am not sure what I am doing wrong…

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
ankurk91commented, May 21, 2017

Seems like img-loader is causing these issues, there is a way to disable image minifications without disabling url processing in css. Check this commit

mix.options({
  processCssUrls: true,
  imgLoaderOptions: {
    enabled: false,
  }
});

Can you try above config until someone fix this issue.

6reactions
the94aircommented, Jan 2, 2018

I am using ubuntu 16.04 and I solved the issue by

  1. sudo apt-get install autoconf
  2. sudo apt-get install dh-autoreconf
  3. npm rebuild mozjpeg

rect4148-5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel Mix error with processCssUrls:true · Issue #808 - GitHub
Laravel Mix Version: 0.11.4 (npm list --depth=0) Node Version (node -v): 7.10.0 ... I am having an error when I try to run...
Read more >
Troubleshooting | Laravel Mix Documentation
I'm having trouble updating/installing Mix.​​ Unfortunately, there are countless reasons why your dependencies may not be installing properly. A common root ...
Read more >
How to fix this error while setting up laravel-mix?
I'm new to Laravel. I use Laravel version 5.4 and this is my package.json file { "private": true, "scripts": { "dev": "npm run...
Read more >
Laravel Mix- Error - Laracasts
Laravel Mix - Error. Hi there,. I have an error while i do npm run dev, the error are as below: npm ERR!...
Read more >
Compiling Assets (Mix) - The PHP Framework For Web Artisans
Laravel Mix, a package developed by Laracasts creator Jeffrey Way, ... To avoid JavaScript errors, be sure to load these files in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found