SASS task in gulp with sourceComments: 'map' produces 'Assertion failed'

一曲冷凌霜 提交于 2019-12-06 08:29:13

问题


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?


回答1:


These options worked for me.

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

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




回答2:


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



来源:https://stackoverflow.com/questions/24397561/sass-task-in-gulp-with-sourcecomments-map-produces-assertion-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!