This error occurs when you use Gulpfile to configure the automatic compilation of a listening file update: "Error:file to import not found or unreadable:./m-body"
And there will be a strange phenomenon, when the change of a file encountered this error and then restart the compilation of the normal monitoring of the file, but the other files are not, it is the file after the error and then restart the compilation is normal.
Try a variety of solutions have no effect, once thought is Gulpfile file writing error:
1 var gulp = require (' gulp '); 2 var sass = require (' Gulp-sass '); 3 var minifycss = require (' gulp-minify-css '); 4 var rename = require (' Gulp-rename '); 5 var Browsersync = require (' Browser-sync '). Create (); 6 7//Static Server 8 gulp.task (' Browser-sync ', function () {9 Browsersync.init ({Ten server: {11 BaseDir: './'}13}); +//Build and Reload css files17 gulp.task (' Compresscss ', function () {18 GULP.SRC (' src/styles/**/*.scss '). Pipe (Sass ({outputstyle: ' compressed ' 21}) 22. On (' Error ', sass.logerror). Pipe (Minifycss ()) 26 pipe (rename ({suffix: '. min '}) ) Pipe (gulp.dest (' prd/styles ')), pipe (Browsersync.stream ()), and (+)/Reload HTML File33 Gulp . Task (' reloadhtml ', function () {gulp.src ('./index.html '). Pipe (Browsersync.stream ()); Files for changes & Recompile39 gulp.task (' Watch ', functioN () {gulp.watch ([' Src/styles/**/*.scss '], [' compresscss ']), Gulp.watch (['./index.html '], [' reloadhtml ']); 42} )//Default task, running just ' gulp ' would move font, Compress JS and scss, start server, watch files.45 gulp.task ( ' Default ', [' compresscss ', ' browser-sync ', ' Watch ']);
Finally found the answer in HTTPS://GITHUB.COM/DLMANNING/GULP-SASS/ISSUES/1: Sublime text and slow hard drive combination caused. We can resolve it by changing the setting Atomic_save to True.
"Gulp-sass" Error:file to import not found or unreadable