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.

Windows Git Bash: mix.sass() Failed to compile: dependency not found

See original GitHub issue
  • Laravel Mix Version: 1.1.0
  • Node Version: 8.1.1
  • NPM Version 5.1.0
  • OS: Windows 10 64-bit
  • Shell: Git Bash for Windows
  • webpack@3.1.0
  • extract-text-webpack-plugin@3.0.0-rc.1
  • sass-loader@6.0.6

Description:

I’m seeing the following error when calling mix.sass() from Git Bash Shell on Windows after upgrading from Laravel Mix 0.12.1 -> 1.1.0

Webpack CMD node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development webpack --config=node_modules/laravel-mix/setup/webpack.config.js --progress --hide-modules

Error Output

95% emitting ERROR  Failed to compile with 1 errors13:13:06

This dependency was not found:

* E:\Code\project\resources\assets\sass\home.scss in multi ./node_modules/laravel-mix/src/builder/mock-entry.js ./resources/assets/sass/home.scss

To install it, you can run: npm install --save E:\Code\project\resources\assets\sass\home.scss      

webpack.mix.js

mix.sass('resources/assets/sass/home.scss', 'dist/home/index.css')
    .options({ processCssUrls: false })
    .version();
  • my pwd in the shell is something more unix-like: /e/Code/project/
  • it appears Mix/Webpack is trying to require my asset via an absolute Windows-style path like: E:\Code\project\
  • tried adding a path.resolve but that didn’t change the error
    • mix.sass(path.resolve('resources/assets/sass/home.scss'), 'dist/home/index.css')
  • this happens only for mix.sass calls, mix.js calls resolve fine (maybe a sass-loader issue?)
  • Error is dependency was not found or dependencies were not found depending on the number of times mix.sass() is called (included for posterity)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

4reactions
sethcarltoncommented, Jul 18, 2017

@mediabeastnz if you are still experiencing issues I finally got this to work. It seems like the package-lock.json file was giving me issues:

The steps I took to finally fix it were: rm -r node_modules/ rm package-lock.json npm cache clean -f npm install

0reactions
jakedownscommented, Jul 18, 2017

^ Ah yes, rm’ing package-lock and forcing npm cache clean is something I had to do as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows Git Bash: mix.sass() Failed to compile: dependency ...
this happens only for mix.sass calls, mix.js calls resolve fine (maybe a sass-loader issue?) Error is dependency was not found or ...
Read more >
Module not found: Error: Can't resolve 'sass-loader'
Go to the project and run below two commands npm install sass-loader -D npm install node-sass -D.
Read more >
Asset Compilation with Laravel Mix and webpack - Laracasts
Laravel provides a useful tool called Mix - a wrapper around webpack ... to compile with 1 errors 1:44:25 PM This dependency was...
Read more >
Mix Release - 'erlexec' not detected, when starting /any/ app ...
build.sh script, that I execute in Windows with GIT Bash: echo "Building App" #!/usr/bin/env bash # exit on error set -o errexit #...
Read more >
Frequently Asked Questions | Laravel Mix Documentation
ERROR Failed to compile with 1 errors This dependency was not found in node_modules: You have two possible solutions: Make sure that resources/assets/img/ ......
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