欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

uniapp之手机app端的mpErrors错误(空白页错误)

程序员文章站 2022-04-29 14:45:53
...

uniapp的vue页面上至少得有根标签,如下,view标签。

<template>
	<view></view>
</template>

<script>
</script>

<style>
</style>

如果没有根标签,如下,在手机端app编译时就会报错。

<template>
</template>

<script>
</script>

<style>
</style>

报以下错误

21:42:59.248  ERROR  TypeError: Cannot set property 'mpErrors' of undefined  
21:42:59.249 TypeError: Cannot set property 'mpErrors' of undefined  
21:42:59.253     at Object.log (E:\softWare\HBuilderX.0.1.47.20180823-alpha.full\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\mpvue-template-compiler\build.js:5106:27)  
21:42:59.261     at compileToWxml (E:\softWare\HBuilderX.0.1.47.20180823-alpha.full\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\mpvue-template-compiler\build.js:5125:21)  
21:42:59.267     at compile (E:\softWare\HBuilderX.0.1.47.20180823-alpha.full\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\plugin\compile-to-template.js:33:9)  
21:42:59.268     at Object.keys.forEach.filePath (E:\softWare\HBuilderX.0.1.47.20180823-alpha.full\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\plugin\generate-components-wxml.js:110:22)  
21:42:59.275     at Array.forEach (<anonymous>)  
21:42:59.279     at generateComponentsWxml (E:\softWare\HBuilderX.0.1.47.20180823-alpha.full\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\plugin\generate-components-wxml.js:72:26)  
21:42:59.281     at Promise (E:\softWare\HBuilderX.0.1.47.20180823-alpha.full\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\plugin\index.js:128:11)  
21:42:59.285     at new Promise (<anonymous>)  
21:42:59.285     at compiler.hooks.emit.tapPromise.compilation (E:\softWare\HBuilderX.0.1.47.20180823-alpha.full\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\plugin\index.js:68:14)  
21:42:59.296     at _err0 (eval at create (E:\softWare\HBuilderX.0.1.47.20180823-alpha.full\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:13:17)  
21:42:59.297     at callback (E:\softWare\HBuilderX.0.1.47.20180823-alpha.full\plugins\uniapp-cli\node_modules\copy-webpack-plugin\dist\index.js:77:17)  
21:42:59.303     at E:\softWare\HBuilderX.0.1.47.20180823-alpha.full\plugins\uniapp-cli\node_modules\copy-webpack-plugin\dist\index.js:118:24  
21:42:59.308     at <anonymous>

相关标签: uniapp