1***@qq.com
1***@qq.com
  • 发布:2019-10-15 15:42
  • 更新:2020-03-16 17:17
  • 阅读:3533

【报Bug】uniapp设置了css渐变背景色编译时会报错

分类:uni-app

详细问题描述

css样式中设置了背景色的话在H5发行编译时会报错,不过在浏览器运行编译时未发生错误。
错误日志:

[HBuilder] 15:14:32.364 Module build failed (from ./node_modules/postcss-loader/src/index.js):  
[HBuilder] 15:14:32.365 TypeError: Cannot read property 'length' of undefined  
[HBuilder] 15:14:32.371     at D:\dstproject\meiyu\pages\login\login.vue:183:2  
[HBuilder] 15:14:32.371     at module.exports (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-value-parser\lib\unit.js:9:22)  
[HBuilder] 15:14:32.378     at args.forEach (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-minify-gradients\dist\index.js:57:61)  
[HBuilder] 15:14:32.379     at Array.forEach (<anonymous>)  
[HBuilder] 15:14:32.385     at decl.value.walk.node (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-minify-gradients\dist\index.js:52:18)  
[HBuilder] 15:14:32.386     at walk (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-value-parser\lib\walk.js:7:16)  
[HBuilder] 15:14:32.393     at ValueParser.walk (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-value-parser\lib\index.js:18:3)  
[HBuilder] 15:14:32.394     at optimise (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-minify-gradients\dist\index.js:40:64)  
[HBuilder] 15:14:32.402     at D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-loader\node_modules\postcss\lib\container.js:190:18  
[HBuilder] 15:14:32.403     at D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-loader\node_modules\postcss\lib\container.js:135:18  
[HBuilder] 15:14:32.412     at Rule.each (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-loader\node_modules\postcss\lib\container.js:101:16)  
[HBuilder] 15:14:32.413     at Rule.walk (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-loader\node_modules\postcss\lib\container.js:131:17)  
[HBuilder] 15:14:32.421     at D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-loader\node_modules\postcss\lib\container.js:148:24  
[HBuilder] 15:14:32.422     at Root.each (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-loader\node_modules\postcss\lib\container.js:101:16)  
[HBuilder] 15:14:32.430     at Root.walk (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-loader\node_modules\postcss\lib\container.js:131:17)  
[HBuilder] 15:14:32.431     at Root.walkDecls (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-loader\node_modules\postcss\lib\container.js:188:19)  
[HBuilder] 15:14:32.441     at css (D:\HBuilderX\plugins\uniapp-cli\node_modules\postcss-minify-gradients\dist\index.js:139:23)  
[HBuilder] 15:14:32.442  ERROR  Build failed with errors.

css代码:

        background: -webkit-gradient(linear, left top, right top, from(#88a1f9), to(#9ac6ff));  
    background: -o-linear-gradient(left, #88a1f9, #9ac6ff);  
    background: linear-gradient(to rigth,#88a1f9,#9ac6ff);

[HBuilderx版本号]
2.3.3.20190923

2019-10-15 15:42 负责人:无 分享
已邀请:
c***@163.com

c***@163.com

您好 这个问题解决了吗

9***@qq.com

9***@qq.com

to rigth 单词都写错了,right

该问题目前已经被锁定, 无法添加新回复