渐渐的
渐渐的
  • 发布:2021-04-07 16:26
  • 更新:2023-05-17 14:35
  • 阅读:11849

【报Bug】关于@dcloudio/vue-cli-plugin-uni 更新最新版本后,error-reporting.js 报错

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 10.15.4 (19E287)

浏览器平台: Chrome

浏览器版本: 70.0.3538.77(正式版本) (64 位)

项目创建方式: CLI

CLI版本号: ^2.0.0-31820210406002

操作步骤:

依赖
"@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-31820210406002",
"@dcloudio/vue-cli-plugin-uni": "^2.0.0-31820210406002",

预期结果:

更新完毕编译报错

实际结果:

更新完毕编译报错

bug描述:

更新最新的 @dcloudio/vue-cli-plugin-uni 版本后,编译打包都抛异常。

更新的库地址: https://registry.npm.taobao.org/@dcloudio/vue-cli-plugin-uni/download/@dcloudio/vue-cli-plugin-uni-2.0.0-31820210406002.tgz

抛异常: /xxxxxx/node_modules/@dcloudio/vue-cli-plugin-uni/lib/error-reporting.js:45
err = err.replace(this._UNI_INPUT_DIR_REG, 'UNI_INPUT_DIR')
^
TypeError: err.replace is not a function
at ErrorReport.report (/xxxxxxx/node_modules/@dcloudio/vue-cli-plugin-uni/lib/error-reporting.js:45:15)
at report (/xxxxxxx/node_modules/@dcloudio/vue-cli-plugin-uni/lib/error-reporting.js:144:24)
at process.on.on.err (/xxxxxx/node_modules/@dcloudio/vue-cli-plugin-uni/lib/error-reporting.js:154:42)
at process.emit (events.js:182:13)
at process._fatalException (internal/bootstrap/node.js:494:27)

2021-04-07 16:26 负责人:无 分享
已邀请:
4***@qq.com

4***@qq.com

同上

l***@163.com

l***@163.com

同上

青阳_1900

青阳_1900

实际测试,@dcloudio/uni-h5 依赖不可删除,否则会有该问题
因为我这边只开发app相关,所以小程序相关依赖我手动删除了。这里贴一下我的 package.json 配置

测试时间 2021-06-03

{  
  "name": "demo",  
  "version": "0.1.0",  
  "private": true,  
  "scripts": {  
    "build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",  
    "dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",  
    "info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js",  
    "test:android": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=android jest -i",  
    "test:ios": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=ios jest -i"  
  },  
  "dependencies": {  
    "@dcloudio/uni-app-plus": "^2.0.0-31920210514002",  
    "@dcloudio/uni-h5": "^2.0.0-31920210514002",  
    "@dcloudio/uni-helper-json": "*",  
    "@dcloudio/uni-i18n": "^2.0.0-31920210514002",  
    "@dcloudio/uni-stat": "^2.0.0-31920210514002",  
    "@vue/shared": "^3.0.0",  
    "core-js": "^3.6.5",  
    "flyio": "^0.6.2",  
    "regenerator-runtime": "^0.12.1",  
    "vue": "^2.6.11",  
    "vue-class-component": "^6.3.2",  
    "vue-property-decorator": "^8.0.0",  
    "vuex": "^3.2.0"  
  },  
  "devDependencies": {  
    "@babel/plugin-syntax-typescript": "^7.2.0",  
    "@babel/runtime": "~7.12.0",  
    "@dcloudio/types": "*",  
    "@dcloudio/uni-automator": "^2.0.0-31920210514002",  
    "@dcloudio/uni-cli-shared": "^2.0.0-31920210514002",  
    "@dcloudio/uni-migration": "^2.0.0-31920210514002",  
    "@dcloudio/uni-template-compiler": "^2.0.0-31920210514002",  
    "@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-31920210514002",  
    "@dcloudio/vue-cli-plugin-uni": "^2.0.0-31920210514002",  
    "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-31920210514002",  
    "@dcloudio/webpack-uni-mp-loader": "^2.0.0-31920210514002",  
    "@dcloudio/webpack-uni-pages-loader": "^2.0.0-31920210514002",  
    "@vue/cli-plugin-babel": "~4.5.0",  
    "@vue/cli-plugin-typescript": "*",  
    "@vue/cli-service": "~4.5.0",  
    "babel-plugin-import": "^1.11.0",  
    "cross-env": "^7.0.2",  
    "jest": "^25.4.0",  
    "mini-types": "*",  
    "miniprogram-api-typings": "*",  
    "postcss-comment": "^2.0.0",  
    "typescript": "^3.0.0",  
    "vue-template-compiler": "^2.6.11"  
  },  
  "browserslist": [  
    "Android >= 4",  
    "ios >= 8"  
  ],  
  "uni-app": {  
    "scripts": {}  
  }  
}  
寒风丶

寒风丶

请问解决了吗 我也遇到了这个问题

3***@qq.com

3***@qq.com

我是删掉Jenkins的操作空间,重新构建,大概第一次不行,多构建几次就成功了(仅供参考)

要回复问题请先登录注册