E
E
Eugene2016-02-07 20:01:30
Windows
Eugene, 2016-02-07 20:01:30

Compiling scss to gulp with @import doesn't work?

Hello, when trying to compile a .scss file that has at least one import, an unknown error appears:

Error in plugin 'sass'
Message:
    scss\styles.scss
undefined

My gulpfile.js:
'use strict';
 
var gulp = require('gulp');
var sass = require('gulp-sass');
 
gulp.task('sass', function () {
  return gulp.src('./scss/**/*.scss')   
    .pipe(sass().on('error', sass.logError))
    .pipe(gulp.dest('./css'));
});
 
gulp.task('sass:watch', function () {
  gulp.watch('./scss/**/*.scss', ['sass']);
});

And the styles.scss I'm trying to compile:
@import "mixins";
@import "variables";
//...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Eugene, 2016-02-07
@LetSevl

It looks like this issue only affects Windows users
https://github.com/dlmanning/gulp-sass/issues/438
UPD: The problem was solved when I moved the project folder to the root of drive C

C
codemix, 2016-02-07
@codemix

Try using single quotes instead of double quotes in your import

@import 'mixins';
@import 'variables';

S
sim3x, 2016-02-07
@sim3x

You definitely have normal sass installed
https://www.npmjs.com/package/node-sass
npm install node-sass --save-dev

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question