0

I get the following error when trying to run 'gulp serve':

[14:14:52] Plumber found unhandled error: Error in plugin 'gulp-sass'

Message: @import directives are not allowed inside mixins and functions

Details: fileName: ./bower_components/bootswatch/spacelab/_bootswatch.scss lineNumber: 8

I upgraded to the latest node version. Ran "npm rebuild node-sass" and "npm rebuild gulp-sass". I tried reinstalling bower packages and npm packages. Is there any sort of assumption I can make. I can try to reinstall npm packages by hand, but there is about 50 and I am afraid it won't do anything.

Any pointers welcome. Will be here until I solve this. 'npm gulp-sass version' gives the same version as my team has and build works for all of them.

fracz
  • 20,536
  • 18
  • 103
  • 149
VSO
  • 11,546
  • 25
  • 99
  • 187

1 Answers1

1

I checked the original source of the Bower component you included and saw the following happening on the line mentioned there:

@mixin web-font($path){
  @import url("#{$path}");
}

As far as I know, "imports" are not allowed in libsass (which is the base for gulp-sass), as it would be a conditional import (which isn't allowed for various reasons) and could lead to possible errors. Ruby Sass is a little more forgiving there.

You might want use a different Bootswatch package there (like bootswatch-sass).

ddprrt
  • 7,424
  • 3
  • 29
  • 25
  • Thanks for the reply. Solved it by copying file from my co-worker. We still don't know why they were different. What you pointed out was indeed the issue, but why it was there is another story altogether. – VSO Sep 13 '15 at 03:28