9***@qq.com
9***@qq.com
  • 发布:2025-12-03 22:30
  • 更新:2026-01-19 14:48
  • 阅读:122

【报Bug】uni-upgrade-center-app报错

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: macOs Tahoe 26.1

HBuilderX类型: 正式

HBuilderX版本号: 4.76

手机系统: Android

手机系统版本号: Android 13

手机厂商: 小米

手机机型: 小米13 PRo

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

一、打开插件市场
二、搜索uni-upgrade-center-app,并导入至项目中
三、按照文档说明进行配置
四、运行

预期结果:

在各个端均正常运行

实际结果:

在app端不报错,但是H5端报错导致无法正常进行调试开发。

bug描述:

通过插件市场导入了uni-upgrade-center-app[0.9.7],并且按照文档说明正确引入了,在app端不报错,但是在H5端运行报错:
项目 ulink 开始编译
当前项目的uniCloud使用的默认服务空间spaceId为:
​当前项目使用了uniCloud,为避免云函数调用跨域问题,建议在HBuilderX内置浏览器里调试,如使用外部浏览器需处理跨域,详见:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinh5​
请注意运行模式下,因日志输出、sourcemap以及未压缩源码等原因,性能和包体积,均不及发行模式。
正在编译中...
INFO Starting development server...
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/call-check-version.ts:94
TS2558:Expected 0 type arguments, but got 1.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/call-check-version.ts:99
TS2304:Cannot find name 'UniCloudError'.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/call-check-version.ts:105
TS18046:'e' is of type 'unknown'.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/check-update.ts:229
TS1005:'}' expected.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/check-update.ts:4
TS2307:Cannot find module '@/uni_modules/uts-openSchema' or its corresponding type declarations.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/check-update.ts:10
TS2355:A function whose declared type is neither 'void' nor 'any' must return a value.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/check-update.ts:82
TS2339:Property 'openDialogPage' does not exist on type 'Uni'.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/check-update.ts:85
TS7006:Parameter 'err' implicitly has an 'any' type.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/check-update.ts:122
TS2451:Cannot redeclare block-scoped variable 'confirmText'.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/check-update.ts:125
TS2451:Cannot redeclare block-scoped variable 'confirmText'.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/check-update.ts:208
TS2339:Property 'installApk' does not exist on type 'Uni'.
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/check-update.ts:215
TS7006:Parameter 'err' implicitly has an 'any' type.

在H5页中报:
/项目路径/uni_modules/uni-upgrade-center-app/utils/call-check-version.ts
[tsl] ERROR at uni_modules/uni-upgrade-center-app/utils/call-check-version.ts:94
TS2558:Expected 0 type arguments, but got 1.

2025-12-03 22:30 负责人:无 分享
已邀请:
DCloud_UNI_LXH

DCloud_UNI_LXH

条件编译处理掉,不要在 web 端写升级中心的代码,升级中心内部使用了条件编译

Ask小助手

Ask小助手

升级中心不支持运行至 H5

解决方案:

使用条件编译处理升级中心部分代码

内容为 AI 生成,仅供参考

要回复问题请先登录注册