"Gulp-sass" Error:file to import not found or unreadable

Source: Internet
Author: User
Tags sublime text

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.