d2y
d2y
  • 发布:2020-06-18 23:51
  • 更新:2020-06-24 11:30
  • 阅读:2872

uniapp 白屏, 有点懵逼

分类:uni-app

说是语法错误, 但是是在运行之后才报的这个错误, 有大佬知道这是啥原因吗?

23:37:18.008 reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Exception: SyntaxError: Unexpected token '...'. Expected a property name.  
23:37:18.035 at weex createInstanceContext:38721  
23:37:18.084 getTemplateInfo== template md5 81a2cb2e52927ce828d414ca11a67616 length 2218210 base64 md5 gaLLLlKSfOgo1BTKEaZ2Fg== response header {"templateSourceBase64MD5":["gaLLLlKSfOgo1BTKEaZ2Fg=="],"templateSourceMD5":["81a2cb2e52927ce828d414ca11a67616"]}
2020-06-18 23:51 负责人:无 分享
已邀请:
DCloud_uni-ad_HDX

DCloud_uni-ad_HDX

三方 npm 包使用了不支持的扩展运算符 "...",Android 上使用的 jscore 对 "..." 支持不完善

解决方案
配置 babel 显式转译
将 package.json 依赖的三方库加到 vue.config.js 节点 transpileDependencies: ['模块名称',...]

  • d2y (作者)

    可以找出栈的错误并找到是那个模块出错的吗? 我无法定位是哪个模块, 我本地写的方法里也大量引用了 ... 展开写法, 项目是 ts, .js 混合引用的

    2020-06-22 12:43

d2y

d2y (作者) - 只是一个渣渣前端

@DCloud_heavensoft

d2y

d2y (作者) - 只是一个渣渣前端

是语法层面的问题吗? 我要头大了, 在 ios 就没问题..
太奇怪了

DCloud_UNI_GSQ

DCloud_UNI_GSQ

机型和系统信息发一下

  • d2y (作者)

    老哥能定位出什么问题吗, 麻烦了

    2020-06-19 12:58

d2y

d2y (作者) - 只是一个渣渣前端

版本信息, 所有机型都报错, 老哥, 求解啊

$ node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js  
uni-app v2.7.9  
uni-app cli v2.0.0-27920200527001  

Environment Info:  

  System:  
    OS: macOS 10.15.4  
    CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz  
  Binaries:  
    Node: 12.3.0 - /var/folders/fx/t5bzx1kx5kb4t44_d9hcsmy40000gn/T/yarn--1592542521169-0.5743863428638496/node  
    Yarn: 1.22.4 - /var/folders/fx/t5bzx1kx5kb4t44_d9hcsmy40000gn/T/yarn--1592542521169-0.5743863428638496/yarn  
    npm: 6.13.0 - /usr/local/bin/npm  
  Browsers:  
    Chrome: 83.0.4103.106  
    Firefox: Not Found  
    Safari: 13.1  
  npmPackages:  
    @dcloudio/types: * => 1.0.2   
    @dcloudio/uni-app-plus: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-app-plus-nvue:  0.0.1   
    @dcloudio/uni-app-plus-nvue-v8:  0.0.1   
    @dcloudio/uni-automator: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-cli-shared: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-h5: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-helper-json: * => 1.0.5   
    @dcloudio/uni-migration: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-mp-alipay: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-mp-baidu: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-mp-qq: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-mp-toutiao: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-mp-weixin: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-quickapp-native: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-quickapp-webview: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-stat: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/uni-template-compiler: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/vue-cli-plugin-hbuilderx: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/vue-cli-plugin-uni: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/vue-cli-plugin-uni-optimize: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/webpack-uni-mp-loader: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @dcloudio/webpack-uni-nvue-loader:  0.0.1   
    @dcloudio/webpack-uni-pages-loader: ^2.0.0-27520200518001 => 2.0.0-27920200527001   
    @hap-toolkit/dsl-vue:  0.6.13   
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0   
    @vue/babel-plugin-transform-vue-jsx:  1.1.2   
    @vue/babel-preset-app:  4.4.4   
    @vue/babel-preset-jsx:  1.1.2   
    @vue/babel-sugar-functional-vue:  1.1.2   
    @vue/babel-sugar-inject-h:  1.1.2   
    @vue/babel-sugar-v-model:  1.1.2   
    @vue/babel-sugar-v-on:  1.1.2   
    @vue/cli-overlay:  4.4.4   
    @vue/cli-plugin-babel: ^4.3.0 => 4.4.4   
    @vue/cli-plugin-router:  4.4.4   
    @vue/cli-plugin-typescript: * => 4.4.4   
    @vue/cli-plugin-vuex:  4.4.4   
    @vue/cli-service: ^4.3.0 => 4.4.4   
    @vue/cli-shared-utils:  4.4.4   
    @vue/component-compiler-utils:  3.1.2 (3.1.2)  
    @vue/preload-webpack-plugin:  1.1.1   
    @vue/web-component-wrapper:  1.2.0   
    mpvue-page-factory:  1.0.1   
    mpvue-template-compiler:  1.0.13   
    uni-h5-vue:  2.6.10   
    uni-mp-vue:  2.6.10   
    vue: ^2.6.11 => 2.6.11   
    vue-class-component: ^6.3.2 => 6.3.2   
    vue-hot-reload-api:  2.3.4   
    vue-loader:  15.9.2 (15.9.2)  
    vue-property-decorator: ^8.0.0 => 8.5.0   
    vue-router:  3.0.1   
    vue-style-loader:  4.1.2   
    vue-template-compiler: ^2.6.11 => 2.6.11   
    vue-template-es2015-compiler:  1.9.1   
    vuex: ^3.2.0 => 3.4.0   
    vuex-persistedstate: ^3.0.1 => 3.0.1   
  npmGlobalPackages:  
    @vue/cli: 4.4.4  

✨  Done in 30.19s.
DCloud_uni-ad_HDX

DCloud_uni-ad_HDX

暂时没有办法定位具体文件,可通过删除代码或在项目中搜索,展开对象的用法

(function() {  
    const a = {  
        a: 1,  
        b: 2  
    }  
    console.log({  
        ...a  
    })  
})();

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