clean-css 类型错误无法读取空的属性"0"



我正在尝试缩小我的代码,当它运行干净的css时,我总是会收到这个错误。

/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/extractor.js:66
  return name.replace(/^-w+-/, '').match(/([a-zA-Z]+)/)[0].toLowerCase();
                                                          ^
TypeError: Cannot read property '0' of null
    at findNameRoot (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/extractor.js:66:59)
    at extract (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/extractor.js:36:9)
    at restructure (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/restructure.js:297:22)
    at optimize (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/advanced.js:71:5)
    at minify (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/clean.js:228:5)
    at whenSourceMapReady (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/clean.js:135:7)
    at Object.whenDone (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/clean.js:155:14)
    at processNext (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/imports/inliner.js:105:13)
    at importFrom (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/imports/inliner.js:79:10)
    at ImportInliner.process (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/imports/inliner.js:38:10)
Error: Hook failed with error code 8: /home/k1ngsley/Projects/mobile_rea/partners-mobile-app/hooks/after_prepare/070_uglify.js
    at /home/k1ngsley/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:195:23
    at _rejected (/home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:797:24)
    at /home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:823:30
    at Promise.when (/home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:1035:31)
    at Promise.promise.promiseDispatch (/home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:741:41)
    at /home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:557:44
    at flush (/home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:448:13)

我读过不同的帖子,说删除评论行等,但所有的都没有为我工作。

任何人都有任何其他想法或方法来解决这个问题

看看min.css实用程序,它速度更快,容错能力更强。

相关内容

  • 没有找到相关文章

最新更新