邠心
邠心
  • 发布:2020-05-26 13:40
  • 更新:2020-05-26 15:22
  • 阅读:1689

新建一个默认模板的nvue页面,运行时报错

分类:uni-app

编译模式配置的是“uni-app”、v3版本
错误内容:
13:33:18.908 TypeError: Cannot read property '1' of null
13:33:18.999 at transition (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\weex-styler\lib\shorthand-parser.js:14:8)
13:33:18.999 at declarations.reduce (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\weex-styler\lib\shorthand-parser.js:54:28)
13:33:18.999 at module.exports (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\weex-styler\lib\shorthand-parser.js:51:23)
13:33:19.052 at D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\weex-styler\index.js:62:31
13:33:19.055 at Object.parse (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\weex-styler\index.js:55:26)
13:33:19.107 at genStyleString (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\webpack-uni-nvue-loader\lib\style.js:36:12)
13:33:19.108 at Object.module.exports (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\webpack-uni-nvue-loader\lib\style.js:8:34)
13:33:19.161 weex createInstanceContext:1146:16
13:33:19.161 webpack_require@weex createInstanceContext:21:34
13:33:19.161 weex createInstanceContext:1133:787
13:33:19.214
webpack_require
@weex createInstanceContext:21:34
13:33:19.214 weex createInstanceContext:1120:79
13:33:19.222 webpack_require@weex createInstanceContext:21:34
13:33:19.242 weex createInstanceContext:100:90
13:33:19.263
webpack_require
@weex createInstanceContext:21:34
13:33:19.283 weex createInstanceContext:85:37
13:33:19.305 global code@weex createInstanceContext:86:12
13:33:19.345 getTemplateInfo== template md5
13:33:19.366 reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Exception: Error: Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-hbuilderx/packages/webpack-uni-nvue-loader/lib/style.js): d68faa71409e17ca178c6616742d1189 length 159580 base64 md5 1o+qcUCeF8oXjGYWdC0RiQ== response header {"templateSourceBase64MD5":["1o+qcUCeF8oXjGYWdC0RiQ=="],"templateSourceMD5":["d68faa71409e17ca178c6616742d1189"]}

2020-05-26 13:40 负责人:无 分享
已邀请:
邠心

邠心 (作者)

唉,社区都没有活跃的人,自问自答吧,原因是全局style不支持nvue写法导致的,解决办法是在App.vue中用条件编译ifndef APP-PLUS-NVUE把全局css屏蔽掉

  • codeyun

    头大了一天没找到问题。终于茫茫帖子中看到了这个。太赞了

    2021-08-09 17:27

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