[tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:192
[HBuilder] 16:57:45.160 TS1005:'}' expected.
[HBuilder] 16:57:45.187 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:3
[HBuilder] 16:57:45.209 TS2307:Cannot find module '@/uni_modules/uts-openSchema' or its corresponding type declarations.
[HBuilder] 16:57:45.233 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:11
[HBuilder] 16:57:45.255 TS2304:Cannot find name 'ComponentPublicInstance'.
[HBuilder] 16:57:45.281 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:11
[HBuilder] 16:57:45.304 TS2355:A function whose declared type is neither 'void' nor 'any' must return a value.
[HBuilder] 16:57:45.333 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:101
[HBuilder] 16:57:45.354 TS2451:Cannot redeclare block-scoped variable 'confirmText'.
[HBuilder] 16:57:45.385 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:104
[HBuilder] 16:57:45.422 TS2451:Cannot redeclare block-scoped variable 'confirmText'.
[HBuilder] 16:57:45.455 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:180
[HBuilder] 16:57:45.488 TS2339:Property 'errMsg' does not exist on type 'InstallApkFail'.
[HBuilder] 16:57:45.514 ERROR Build failed with errors.
![Burger](https://img-cdn-tc.dcloud.net.cn/account/identicon/e5fcb91fac81d89f2ef0e9d0b17db042.png)
- 发布:2024-08-22 17:16
- 更新:2024-08-26 19:32
- 阅读:144
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: w10
HBuilderX类型: 正式
HBuilderX版本号: 4.25
手机系统: Android
手机系统版本号: Android 13
手机厂商: 华为
手机机型: Magic5
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
更新升级中心之后打包报错
更新升级中心之后打包报错
预期结果:
不报错
不报错
实际结果:
报错
报错
bug描述:
App升级中心打包报错,没用到ts也会报错
![DCloud_UNI_LXH](http://img-cdn-tc.dcloud.net.cn/uploads/avatar/001/59/00/26_avatar_mid.jpg?v=0)
这个报错应该是你没有下载依赖,去插件市场下载一下 uts-openSchema
-
-
-
Burger (作者)
回复 DCloud_UNI_LXH: component?.$callMethod('show', true, uniUpgradeCenterResult)这里的component提示没定义
2024-08-27 11:11
-
回复 Burger: 可以把 uni-app-x 的条件编译都去掉。我使用最新版的升级中心 vue2 项目,最新稳定版 HX,打包了几次,都是没有问题的,可以成功打包
2024-08-28 11:31
-
-
-
回复 Burger:
- 确认你的升级中心版本
- 确认你的 hx 版本
- 发我你打包报错的升级中心插件包
- 暂时先只去掉 uni-app-x 的条件编译,因为你是打包 uni1,去掉这个对你没有影响
2024-08-28 19:37
-
Burger (作者)
回复 DCloud_UNI_LXH: 升级中心版本0.8.3,hx版本4.24.2024072208,现在打包不报错了,之前因为把check-update.ts整个删掉,升级版本时没有更新弹窗,下次更新再试试吧
2024-08-29 08:59
Burger (作者)
本地不会,就是打包会报错
2024-08-23 08:36
Burger (作者)
删掉check-update.ts这个文件可以正常打包,但是上传新版本,旧版本(上一个删除check-update.ts的版本)没有升级更新弹框
2024-08-23 08:39
DCloud_UNI_LXH
回复 Burger: 这个文件你肯定不能删的,但是你可以删除这个文件里面 updateUseModal 相关的逻辑,试试可以打包吗
2024-08-23 10:28
Burger (作者)
回复 DCloud_UNI_LXH: 不行,将ts的updateUseModal的函数删除了也无法打包
[HBuilder] 10:42:35.094 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:83
[HBuilder] 10:42:35.117 TS1005:'}' expected.
[HBuilder] 10:42:35.138 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:3
[HBuilder] 10:42:35.161 TS2307:Cannot find module '@/uni_modules/uts-openSchema' or its corresponding type declarations.
[HBuilder] 10:42:35.187 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:11
[HBuilder] 10:42:35.214 TS2304:Cannot find name 'ComponentPublicInstance'.
[HBuilder] 10:42:35.237 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:11
[HBuilder] 10:42:35.261 TS2355:A function whose declared type is neither 'void' nor 'any' must return a value.
[HBuilder] 10:42:35.291 ERROR Build failed with errors.
2024-08-23 10:44
DCloud_UNI_LXH
回复 Burger: 你是 uni1 还是 uni x 打包?你把你报错的这个文件,发出来我看看
2024-08-24 11:00
Burger (作者)
回复 DCloud_UNI_LXH: uni1打包的,文件就是check-update.ts,直接从插件市场更新下来的,只删除了updateUseModal这个方法
2024-08-26 10:04
DCloud_UNI_LXH
回复 Burger: 这个文件里面应该有一个
export default
的方法,然后export default
使用了条件编译,你把// #ifdef UNI-APP-X
条件编译的部分删除掉,算上条件编译就三行代码,别删多了。然后打包试试看2024-08-26 14:57
Burger (作者)
回复 DCloud_UNI_LXH: 我将
// #ifdef UNI-APP-X
export default function (component : ComponentPublicInstance | null = null) : Promise<UniUpgradeCenterResult> {
// #endif
这个删掉,还是报错
[tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:79
[HBuilder] 15:33:12.418 TS1128:Declaration or statement expected.
[HBuilder] 15:33:12.444 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:3
[HBuilder] 15:33:12.464 TS2307:Cannot find module '@/uni_modules/uts-openSchema' or its corresponding type declarations.
[HBuilder] 15:33:12.489 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:65
[HBuilder] 15:33:12.516 TS2304:Cannot find name 'component'.
[HBuilder] 15:33:12.544 ERROR Build failed with errors.
2024-08-26 15:33