在为生产构建我的 Angular 项目时,ng buid --prod
我收到以下错误:
10% 构建模块 3/4 个模块 1 个活动模块 .../client/src/styles.sass/media/client/node_modules/clean-css/lib/optimizer/level-1/optimize.js:429 context.warnings.push ('无效的值标记在' + formatPosition(value[0][1][2][0]) + '。忽略。');
TypeError: Cannot read property '1' of undefined
at optimizeBody (/media/client/node_modules/clean-css/lib/optimizer/level-1/optimize.js:429:82)
at level1Optimize (/media/client/node_modules/clean-css/lib/optimizer/level-1/optimize.js:657:9)
at level1Optimize (/media/client/node_modules/clean-css/lib/optimizer/level-1/optimize.js:648:9)
at optimize (/media/client/node_modules/clean-css/lib/clean.js:144:5)
at /media/client/node_modules/clean-css/lib/clean.js:120:29
at /media/client/node_modules/clean-css/lib/reader/read-sources.js:26:64
at loadOriginalSources (/media/client/node_modules/clean-css/lib/reader/load-original-sources.js:26:5)
at /media/client/node_modules/clean-css/lib/reader/read-sources.js:26:14
at applySourceMaps (/media/client/node_modules/clean-css/lib/reader/apply-source-maps.js:34:5)
at /media/client/node_modules/clean-css/lib/reader/read-sources.js:25:12
at fromStyles (/media/client/node_modules/clean-css/lib/reader/read-sources.js:152:5)
at fromString (/media/client/node_modules/clean-css/lib/reader/read-sources.js:48:10)
at doReadSources (/media/client/node_modules/clean-css/lib/reader/read-sources.js:33:12)
at readSources (/media/client/node_modules/clean-css/lib/reader/read-sources.js:24:10)
at /media/client/node_modules/clean-css/lib/clean.js:115:12
at _combinedTickCallback (internal/process/next_tick.js:131:7)
早些时候,这一天一切正常。但现在这个。
这似乎是由某些 css 优化器引起的,clean-css
但我不知道如何修复它。(我尝试更新并重新安装角度)