使用SASS而不是SCSS时,Gulp会生成抛出错误

时间:2016-03-17 11:00:14

标签: css wordpress automation sass gulp

我正在使用gulp工作流程构建的样板WordPress主题。 CSS是使用SCSS编写的,我发现SASS更直观,更易于使用。但是,当我将gulp任务更改为专注于SASS而不是SCSS文件时,每当我运行任务时都会收到此错误:

unlock git:(master) ✗ gulp styles
[11:37:25] Using gulpfile ~/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/gulpfile.js
[11:37:25] Starting 'styles'...
[11:37:25] Finished 'styles' after 20 ms
buffer.js:169
  throw new TypeError('must start with number, buffer, array or string');
  ^

TypeError: must start with number, buffer, array or string
    at fromObject (buffer.js:169:9)
    at new Buffer (buffer.js:62:10)
    at Transform.transform [as _transform] (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-combine-media-queries/index.js:145:21)
    at Transform._read (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-combine-media-queries/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at Transform._write (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-combine-media-queries/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-combine-media-queries/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-combine-media-queries/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at Transform.Writable.write (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-combine-media-queries/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-filter/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-filter/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-filter/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
    at emitNone (events.js:67:13)
    at DestroyableTransform.emit (events.js:166:7)
    at emitReadable_ (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-filter/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:448:10)
    at emitReadable (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-filter/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:444:5)
    at readableAddChunk (/Users/tijaniogunlende/Desktop/unlockafrica/wordpress/wp-content/themes/unlock/node_modules/gulp-filter/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:187:9)

当我将文件更改回SCSS源时,一切正常。 我知道它的东西很小但却无法弄明白。

提前致谢。

1 个答案:

答案 0 :(得分:0)

我有同样的错误,但是我没有任何样式表。所以基本上我没有造型,然后它试图将所有这些都放在一个文件中。我通过创建一个文件并在其中添加一些注释来修复我的内容,这样它至少可以使用一些内容。

我不知道这有多大帮助,但无论如何它都在这里。