qsh
qsh
  • 发布:2020-04-08 21:21
  • 更新:2020-04-14 10:48
  • 阅读:1518

【报Bug】真机调试,白屏报错,vue-cli创建的项目

分类:uni-app

详细问题描述

(DCloud产品不会有明显的bug,所以你遇到的问题大都是在特定环境下才能重现的问题,请仔细描述你的环境和重现方式,否则DCloud很难排查解决你的问题)

[内容]

重现步骤首先项目 npm i

[步骤]

[结果]真机调试白屏报错,提交了附件代码可以帮忙查看。

[期望]真机可以调试

[如果语言难以表述清晰,拍一个视频或截图,有图有真相]

IDE运行环境说明

[HBuilder 或 HBuilderX。如果你用其他工具开发uni-app,也需要在此说明]

[IDE版本号]

[windows版本号]

[mac版本号]

uni-app运行环境说明

[运行端是h5或app或某个小程序?]

[运行端版本号]2.6.9

[项目是cli创建的还是HBuilderX创建的?如果是cli创建的,请更新到最新版cli再试]

[编译模式说明:自定义组件模式?纯nvue模式?v3模式?]

App运行环境说明

[Android版本号]

[iOS版本号]

[手机型号]

[模拟器型号]

附件

[IDE问题请提供HBuilderX运行日志。菜单帮助-查看运行日志,点右键打开文件所在目录,将log文件压缩成zip包上传]

[App问题请提供可重现问题的代码片段,你补充的细一点,问题就解决的快一点]

[App安装包或H5地址]

[可重现代码片段]

联系方式18265696321

[QQ]1239848659

2020-04-08 21:21 负责人:无 分享
已邀请:
DCloud_uni-ad_HDX

DCloud_uni-ad_HDX

因依赖的三方库使用了新的 js 语法 ... 扩展运算符在低端设备上出现错误导致白屏

当前版本解决方案

1.替换 uni-app 编译器

源(参考 github 此次修复代码)  
https://github.com/dcloudio/uni-app/tree/master/packages/vue-cli-plugin-uni/lib/options.js  

替换到项目  
node_modules/@dcloudio/vue-cli-plugin-uni/lib/options.js

2.配置 babel 显式转译,vue.config.js 增加 2 个库

transpileDependencies: [..., 'uni-request', 'uni-hold-tabbar'],
  • qsh (作者)

    谢了,这样我在更新编译器的话是不是也没有影响?

    2020-04-10 09:09

  • qsh (作者)

    顺便问一下,支持原生App本地打包吗?为什么本地打包还是出现问题

    2020-04-10 09:55

  • DCloud_uni-ad_HDX

    回复 qsh: 没有影响,和我们发版修复是一样的,支持,报什么错误

    2020-04-10 10:29

  • qsh (作者)

    回复 DCloud_uni-ad_HDX: 谢了,解决了

    2020-04-10 15:50

DCloud_uni-ad_HDX

DCloud_uni-ad_HDX

已修复,npm update

  • 3***@qq.com

    我这问题和楼主一样,npm update后,还是报错,{

    "name": "qiyego_wxchat",

    "version": "0.1.0",

    "private": true,

    "scripts": {

    "serve": "npm run dev:h5",

    "build": "npm run build:h5",

    "build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",

    "build:custom": "cross-env NODE_ENV=production uniapp-cli custom",

    "build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",

    "build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build",

    "build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build",

    "build:mp-qq": "cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build",

    "build:mp-toutiao": "cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build",

    "build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build",

    "build:quickapp-light": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-light vue-cli-service uni-build",

    "build:quickapp-vue": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-vue vue-cli-service uni-build",

    "dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",

    "dev:custom": "cross-env NODE_ENV=development uniapp-cli custom",

    "dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",

    "dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch",

    "dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch",

    "dev:mp-qq": "cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch",

    "dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch",

    "dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch",

    "dev:quickapp-light": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-light vue-cli-service uni-build --watch",

    "dev:quickapp-vue": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-vue vue-cli-service uni-build --watch",

    "info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js",

    "serve:quickapp-vue": "node node_modules/@dcloudio/uni-quickapp-vue/bin/serve.js",

    "test:h5": "cross-env NODE_ENV=test UNI_PLATFORM=h5 vue-cli-service uni-build"

    },

    "dependencies": {

    "@dcloudio/uni-app-plus": "^2.0.0-27920200527001",

    "@dcloudio/uni-h5": "^2.0.0-27920200527001",

    "@dcloudio/uni-helper-json": "",

    "@dcloudio/uni-mp-alipay": "^2.0.0-27920200527001",

    "@dcloudio/uni-mp-baidu": "^2.0.0-27920200527001",

    "@dcloudio/uni-mp-qq": "^2.0.0-27920200527001",

    "@dcloudio/uni-mp-toutiao": "^2.0.0-27920200527001",

    "@dcloudio/uni-mp-weixin": "^2.0.0-27920200527001",

    "@dcloudio/uni-quickapp-light": "^2.0.0-26920200424005",

    "@dcloudio/uni-quickapp-vue": "^2.0.0-26920200424005",

    "@dcloudio/uni-stat": "^2.0.0-27920200527001",

    "@dcloudio/uni-ui": "^1.2.1",

    "babel-runtime": "^6.26.0",

    "core-js": "^3.6.4",

    "flyio": "^0.6.2",

    "jweixin-module": "^1.6.0",

    "qrcodejs2": "^0.0.2",

    "regenerator-runtime": "^0.12.1",

    "tki-qrcode": "^0.1.6",

    "vconsole": "^3.3.4",

    "vue": "^2.6.11",

    "vue-nocaptcha": "^0.2.8",

    "vuex": "^3.0.1"

    },

    "devDependencies": {

    "@dcloudio/types": "^1.0.1",

    "@dcloudio/uni-cli-shared": "^2.0.0-27920200527001",

    "@dcloudio/uni-migration": "^2.0.0-27920200527001",

    "@dcloudio/uni-template-compiler": "^2.0.0-27920200527001",

    "@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-27920200527001",

    "@dcloudio/vue-cli-plugin-uni": "^2.0.0-27920200527001",

    "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-27920200527001",

    "@dcloudio/webpack-uni-mp-loader": "^2.0.0-27920200527001",

    "@dcloudio/webpack-uni-pages-loader": "^2.0.0-27920200527001",

    "@vue/cli-plugin-babel": "^4.4.1",

    "@vue/cli-service": "^4.4.1",

    "babel-plugin-import": "^1.11.0",

    "cross-env": "^7.0.2",

    "less-loader": "^6.1.0",

    "mini-types": "
    ",

    "miniprogram-api-typings": "^2.11.0",

    "node-sass": "^4.14.1",

    "postcss-comment": "^2.0.0",

    "sass-loader": "^8.0.2",

    "vue-template-compiler": "^2.6.11"

    },

    "nodeSassConfig": {

    "binarySite": "https://npm.taobao.org/mirrors/node-sass"

    },

    "browserslist": [

    "Android >= 4",

    "ios >= 8"

    ],

    "uni-app": {

    "scripts": {}

    }

    }

    2020-06-12 14:56

  • 3***@qq.com

    补充,使用的npm run test:h5打包

    2020-06-12 16:08

  • DCloud_uni-ad_HDX

    回复 3***@qq.com: 报什么错?npm run test:h5 是自动化测试命令,参考文档 https://uniapp.dcloud.net.cn/collocation/auto/quick-start

    2020-06-15 11:58

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