【发布时间】:2016-03-17 11:00:13
【问题描述】:
我正在使用 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 源时,一切正常。 我知道它的一些小问题,但一直无法弄清楚。
提前致谢。
【问题讨论】:
-
不要截图代码。
标签: css wordpress automation sass gulp