3

I have a web app I'm developing using AngularJS, D3, Pixi.js, and gulp as a build system. It all works great together, except gulp-sass. Here's the relevant code:

gulp.task('sass-dev', ['clean-dev'], function() {
  return gulp.src( cfg.appFiles.rootSass )
    .pipe( sass({ errLogToConsole: true }))
    .pipe( gulp.dest( cfg.buildDir+cfg.destDirs.css  ) )
    .pipe( livereload( server ) );
});

cfg is just a variable that has predefined globs. If I make the third line

 .pipe( sass({ errLogToConsole: true, sourceComments: 'map' }))

by adding the mapping of the source (useful for debugging), I get the following fatal error.

Assertion failed: (val->IsString()), function _NanGetExternalParts, file ../node_modules/nan/nan.h, line 1725.
Abort trap: 6

On my colleague's computer, it works perfectly with or without mapping. On mine, it fails every time with the source comments mapped, and works perfectly without mapping. Both computers are iMacs running the latest version of node (npm), bower, and OS X.

Any idea what could be causing this? Issue in gulp or gulp-sass itself?

Dylan Gattey
  • 1,713
  • 13
  • 34
  • What version of Sass is being used on both systems? – cimmanon Jun 24 '14 at 22:55
  • @cimmanon We're using gulp-sass 0.7.1 – Dylan Gattey Jun 24 '14 at 23:53
  • First: Please read the docs: [https://github.com/sass/node-sass](https://github.com/sass/node-sass). Second: you need the file param. – Navelpluisje Jun 25 '14 at 19:10
  • The files are what is being piped into the sass command. And I have read the docs. Please see https://github.com/dlmanning/gulp-sass since we're using gulp as a build system. Example from their docs: `var gulp = require('gulp'); var sass = require('gulp-sass') gulp.task('sass', function () { gulp.src('./scss/*.scss').pipe(sass()).pipe(gulp.dest('./css')); });` – Dylan Gattey Jun 25 '14 at 21:02
  • I've got exactly the same issue -except on ubuntu. Anyone got a solution or workaround yet? – TrevTheDev Jun 27 '14 at 03:47
  • These options worked for me. `{ errLogToConsole: true, sourceComments: 'map', sourceMap: 'sass' }`. There's always seems to be something weird going on. – Bill Criswell Jun 27 '14 at 04:33

2 Answers2

4

These options worked for me.

{ errLogToConsole: true, sourceComments: 'map', sourceMap: 'sass' }.

There's always seems to be something weird going on.

Bill Criswell
  • 32,161
  • 7
  • 75
  • 66
1

In my case, the cause was an empty scss file. Adding a comment to the file, or removing the scss file, solved this problem

Laurens Rietveld
  • 958
  • 1
  • 11
  • 21