Ennicolem Ennicolem - 18 days ago 11
Sass (Sass) Question

SASS stops compiling: File to import not found or unreadable: util/util

I have started a Laravel 5.3 project with Zurb Foundation (sass) a while ago. I configured gulpfile.js to compile my sass and it used to work properly until today where it stopped compiling. It worked a couple days ago.
I did not touch the code or upgrade anything in between...

Error:

MBP-Nicolas:v1 nicolas$ gulp
[15:50:09] Using gulpfile ~/Documents/Developpement/PHP/Laravel/Project/v1/gulpfile.js
[15:50:09] Starting 'default'...
[15:50:09] Starting 'sass'...

Fetching Sass Source Files...
- resources/assets/sass/app.scss


Saving To...
- public/css/app.css

[15:50:11] Finished 'default' after 1.31 s
[15:50:11] gulp-notify: [Laravel Elixir] Sass Compilation Failed: resources/assets/sass/_settings.scss
Error: File to import not found or unreadable: util/util
Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss
on line 43 of resources/assets/sass/_settings.scss
>> @import 'util/util';
^

{ [Error: resources/assets/sass/_settings.scss
Error: File to import not found or unreadable: util/util
Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss
on line 43 of resources/assets/sass/_settings.scss
>> @import 'util/util';
^
]
status: 1,
file: '/Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss',
line: 43,
column: 1,
message: 'resources/assets/sass/_settings.scss\nError: File to import not found or unreadable: util/util\n Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss\n on line 43 of resources/assets/sass/_settings.scss\n>> @import \'util/util\';\n ^\n',
formatted: 'Error: File to import not found or unreadable: util/util\n Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss\n on line 43 of resources/assets/sass/_settings.scss\n>> @import \'util/util\';\n ^\n',
messageFormatted: '\u001b[4mresources/assets/sass/_settings.scss\u001b[24m\nError: File to import not found or unreadable: util/util\n Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss\n on line 43 of resources/assets/sass/_settings.scss\n>> @import \'util/util\';\n ^\n',
messageOriginal: 'File to import not found or unreadable: util/util\nParent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss',
relativePath: 'resources/assets/sass/_settings.scss',
name: 'Error',
stack: 'Error: resources/assets/sass/_settings.scss\nError: File to import not found or unreadable: util/util\n Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss\n on line 43 of resources/assets/sass/_settings.scss\n>> @import \'util/util\';\n ^\n\n at options.error (/Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/node_modules/node-sass/lib/index.js:292:26)',
showStack: false,
showProperties: true,
plugin: 'gulp-sass' }
[15:50:11] Finished 'sass' after 1.38 s
[15:50:11] Starting 'copy'...

Fetching Copy Source Files...
- node_modules/font-awesome/fonts/**/*


Saving To...
- public/fonts

[15:50:11] Finished 'copy' after 55 ms
[15:50:11] Starting 'styles'...

Fetching Styles Source Files...
- node_modules/font-awesome/css/font-awesome.min.css
- public/css/app.css


Saving To...
- public/css/all.css

[15:50:11] gulp-notify: [Laravel Elixir] Stylesheets Merged!
[15:50:11] Finished 'styles' after 95 ms
[15:50:11] Starting 'scripts'...

Fetching Scripts Source Files...
- node_modules/jquery/dist/jquery.js
- node_modules/foundation-sites/dist/foundation.min.js
- resources/assets/js/main.js


Saving To...
- public/js/all.js

[15:50:12] gulp-notify: [Laravel Elixir] Scripts Merged!
[15:50:12] Finished 'scripts' after 1.3 s


I don't really know what else you need but here is my gulpfile:

var elixir = require('laravel-elixir');

elixir(function(mix) {

//Compilation SASS
mix.sass('app.scss', null, null, { includePaths: ['node_modules/foundation-sites/scss'] });

//Copy of fonts
mix.copy('node_modules/font-awesome/fonts', 'public/fonts');

//Compilation CSS
mix.styles([
'../../../node_modules/font-awesome/css/font-awesome.min.css',
'../../../public/css/app.css'
]);

//Compilation JavaScript
var JSJquery = '../../../node_modules/jquery/dist/jquery.js';
var JSFoundation = '../../../node_modules/foundation-sites/dist/foundation.min.js';

mix.scripts([
JSJquery,
/*JSFoundation + 'foundation.core.js',
JSFoundation + 'foundation.util.keyboard.js',
JSFoundation + 'foundation.util.box.js',
JSFoundation + 'foundation.util.triggers.js',
JSFoundation + 'foundation.util.mediaQuery.js',
JSFoundation + 'foundation.util.motion.js',
JSFoundation + 'foundation.reveal.js',
JSFoundation + 'foundation.offcanvas.js',*/
JSFoundation,
'main.js'
]);

});


Line 43 of _settings.scss is
@import 'util/util';
.
If it is useful, some versions of the tools:


  1. node -v: v4.6.0

  2. npm -v: 2.15.9

  3. sass -v: Sass 3.4.15 (Selective
    Steve)



But like I said, I don't recall upgrading any of it.

Thanks for your help.

Answer

According to your gulp file and sass file you should have your util.scss file at location 'node_modules/foundation-sites/scss/util/util.scss' This is because you have the following in your gulp file

mix.sass('app.scss', null, null, { includePaths: ['node_modules/foundation-sites/scss'] });

and the following in your settings file

util/util

Ensure the file is at that location, if not, modify your gulpfile or settings file accordingly.

Edit: Can you post your 'sass' task from your gulpfile, this might help?