SASS task in gulp with sourceComments: #39;map#39; produces #39;Assertion failed#39;(带有 sourceComments 的 Gulp 中的 SASS 任务:map 产生 Assertion failed)
问题描述
我正在开发一个使用 AngularJS、D3、Pixi.js 和 gulp 作为构建系统的 Web 应用程序.除了 gulp-sass
之外,这一切都很好.以下是相关代码:
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
只是一个具有预定义全局变量的变量.如果我做第三行
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
在我同事的计算机上,无论有没有映射,它都能完美运行.在我看来,每次映射源注释时它都会失败,并且在没有映射的情况下也能完美运行.两台计算机都是运行最新版本的 node
(npm
)、bower
和 OS X
的 iMac.
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
.
知道是什么原因造成的吗?gulp
或 gulp-sass
本身的问题?
Any idea what could be causing this? Issue in gulp
or gulp-sass
itself?
推荐答案
这些选项对我有用.
{ errLogToConsole: true, sourceComments: 'map', sourceMap: 'sass' }.
似乎总是有一些奇怪的事情发生.
There's always seems to be something weird going on.
这篇关于带有 sourceComments 的 Gulp 中的 SASS 任务:'map' 产生 'Assertion failed'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:带有 sourceComments 的 Gulp 中的 SASS 任务:'map' 产生 'Assertion failed'


- 失败的 Canvas 360 jquery 插件 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 400或500级别的HTTP响应 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06