a***@mail.hkgo.com
a***@mail.hkgo.com
  • 发布:2023-05-25 15:19
  • 更新:2023-05-25 15:19
  • 阅读:384

【报Bug】cli工程,windows下hbuildler打包app和自定义基座提示文件查找失败 'wx'

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: windows10

手机系统: 全部

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: CLI

CLI版本号: 4.5.19

测试过的手机:

示例代码:

package.json


{  
  "name": "hkgo-mall-app-cli",  
  "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:h5test": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service --mode h5test uni-build",  
    "build:h5pre": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service --mode h5pre uni-build",  
    "build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service --mode h5production 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"  
  },  
  "dependencies": {  
    "@dcloudio/uni-app": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/uni-app-plus": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/uni-h5": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/uni-i18n": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/uni-stacktracey": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/uni-stat": "^2.0.2-alpha-3080320230522001",  
    "@vue/shared": "^3.0.0",  
    "core-js": "^3.6.5",  
    "flyio": "^0.6.2",  
    "image-tools": "^1.4.0",  
    "moment": "^2.29.4",  
    "vue": "^2.6.11",  
    "vue-i18n": "^8.28.2",  
    "vue-jsonp": "^2.0.0",  
    "vue-social-sharing": "^3.0.9",  
    "vuex": "^3.2.0"  
  },  
  "devDependencies": {  
    "@dcloudio/tpes": "^3.3.2",  
    "@dcloudio/uni-automator": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/uni-cli-i18n": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/uni-cli-shared": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/uni-helper-json": "*",  
    "@dcloudio/uni-migration": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/uni-template-compiler": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/vue-cli-plugin-uni": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.2-alpha-3080320230522001",  
    "@dcloudio/webpack-uni-pages-loader": "^2.0.2-alpha-3080320230522001",  
    "@vue/cli-plugin-babel": "~4.5.19",  
    "@vue/cli-service": "~4.5.19",  
    "babel-plugin-import": "^1.11.0",  
    "cross-env": "^7.0.2",  
    "jest": "^25.4.0",  
    "mini-types": "*",  
    "miniprogram-api-typings": "*",  
    "node-sass": "npm:dart-sass@^1.25.0",  
    "postcss-comment": "^2.0.0",  
    "sass-loader": "^7.1.0",  
    "vue-template-compiler": "^2.6.11"  
  },  
  "browserslist": [  
    "Android >= 4.4",  
    "ios >= 9"  
  ],  
  "uni-app": {  
    "scripts": {}  
  }  
}

操作步骤:

云打包选择自定义基座和正式包

预期结果:

正常打包基座和app

实际结果:

[HBuilder] 14:59:54.014 项目 'hkgo-mall-app' 开始编译...
[HBuilder] 14:59:58.647 当前项目的uniCloud使用的默认服务空间spaceId为:mp-ec331155-5ed0-42c9-b407-b31353b012eb
[HBuilder] 14:59:58.942 ​已开启 uni统计2.0 版本​
[HBuilder] 14:59:58.946 ​【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097​
[HBuilder] 14:59:58.957 3.8.3
[HBuilder] 14:59:59.693 正在编译中...
[HBuilder] 15:01:24.493 项目 'hkgo-mall-app' 编译成功。
[HBuilder] 15:01:24.497 文件查找失败:'wx' at ..\node_modules\@dcloudio\vue-cli-plugin-uni\packages\uni-cloud\dist\index.js:1
[HBuilder] 15:01:24.499 文件查找失败:'wx' at utils\initModal.js:1
[HBuilder] 15:01:24.503 文件查找失败:'wx' at utils\SubscribeMessage.js:1
[HBuilder] 15:01:24.504 ERROR Build failed with errors.

bug描述:

cli工程,hbuildler打包app和自定义基座提示

文件查找失败:'wx' at ..\node_modules\@dcloudio\vue-cli-plugin-uni\packages\uni-cloud\dist\index.js:1

就是工程里类似wx.xx的方法都会报这个错,即便是做了空的校验也会触发,自己工程的代码还能改,但是这个vue-cli-plugin-uni 解决不了

wx都是第三方代码里用的有些能改有些不能改。

windows上node16就会出这个问题,node18出ssl的问题
mac上node14会出这个问题,node16就正常

项目是之前是普通hbuilder工程,上周改成了cli工程。

vue-cli-plugin-uni依赖版本号
2.0.2-3071120230427001
2.0.2-alpha-3080320230522001

都试过了一样

2023-05-25 15:19 负责人:无 分享
已邀请:

要回复问题请先登录注册