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

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>

猜你喜欢

转载自blog.csdn.net/weixin_44724060/article/details/93481379