网中网 发表于 2017-2-24 13:02:46

semantic-ui使用gulp执行build-css报错

  1.执行gulp build-css报错



Starting 'build-css'...
Building CSS
Potentially unhandled rejection TypeError: Cannot call method 'match' of und
efined
at DestroyableTransform.module.exports.settings.plumber.less.errorHandler (E
:\devtools\nodejs4\node_modules\semantic-ui\tasks\config\tasks.js:92:29)
  2.找到\devtools\nodejs4\node_modules\semantic-ui\tasks\config\tasks.js:92行代码为



  if(error.filename.match(/theme.less/)) {
  从错误提示可以看出error.filename没有match方法,修改代码将error打印出来,



  console.error(error);
  console.error(error.filename);



Starting 'build-css'...
Building CSS

undefined
Potentially unhandled rejection TypeError: Cannot call method 'match' of und
efined
at DestroyableTransform.module.exports.settings.plumber.less.errorHandler (E
:\devtools\nodejs4\node_modules\semantic-ui\tasks\config\tasks.js:94:29)

  从输出日志可以看出error.filename为underfined,而no writecb in Transform class。。。
  进一步得知no writecb...错误是nodejs抛出的错误。
  事实证明是bug, Installing gulp-autoprefixer@2.3.1 fixed it。
页: [1]
查看完整版本: semantic-ui使用gulp执行build-css报错