h***@126.com
h***@126.com
  • 发布:2025-12-12 11:10
  • 更新:2025-12-12 11:11
  • 阅读:14

0.9.7版本的uni-upgrade-center运行错误

分类:HBuilderX

只要项目里加了video组件,就会报下方错误

报错内容如下:
11:01:04.885 正在差量编译...
11:01:06.721 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\call-check-version.ts:94
11:01:06.721 TS2558:Expected 0 type arguments, but got 1.
11:01:06.721 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\call-check-version.ts:99
11:01:06.721 TS2304:Cannot find name 'UniCloudError'.
11:01:06.721 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\call-check-version.ts:105
11:01:06.721 TS18046:'e' is of type 'unknown'.
11:01:06.721 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:229
11:01:06.722 TS1005:'}' expected.
11:01:06.722 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:4
11:01:06.722 TS2307:Cannot find module '@/uni_modules/uts-openSchema' or its corresponding type declarations.
11:01:06.722 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:10
11:01:06.722 TS2355:A function whose declared type is neither 'void' nor 'any' must return a value.
11:01:06.722 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:81
11:01:06.722 TS2339:Property 'openDialogPage' does not exist on type 'Uni'.
11:01:06.722 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:84
11:01:06.722 TS7006:Parameter 'err' implicitly has an 'any' type.
11:01:06.722 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:121
11:01:06.722 TS2451:Cannot redeclare block-scoped variable 'confirmText'.
11:01:06.722 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:124
11:01:06.722 TS2451:Cannot redeclare block-scoped variable 'confirmText'.
11:01:06.722 [tsl] ERROR at uni_modules\uni-upgrade-center-app\utils\check-update.ts:217
11:01:06.722 TS2339:Property 'errMsg' does not exist on type 'InstallApkFail'.

2025-12-12 11:10 负责人:无 分享
已邀请:
Ask小助手

Ask小助手 - Ask社区AI助手

根据您描述的TypeScript编译错误(TS2558、TS2304等),这通常是由于HBuilderX版本与插件兼容性项目配置问题导致。重点排查以下两点:

  1. HBuilderX版本问题
    当前uni-app正式版为4.85(alpha 4.86),而uni-upgrade-center 0.9.7可能存在TS类型定义不兼容。建议:

    • 升级HBuilderX至最新正式版(4.85+)
    • 检查manifest.jsontranspiler是否设置为babel(若用TS需确保配置正确)
  2. 插件冲突可能性
    sunny-video组件(uts插件)与uni-upgrade-center可能存在命名空间冲突。

    • 确认两者是否均需保留?尝试临时移除sunny-video测试是否仍报错
    • uts插件需严格放在uni_modules目录,检查路径是否正确(错误中@/uni_modules/uts-openSchema路径异常)

⚠️ 注意:鸿蒙平台与App(Android/iOS)实现分离,若在鸿蒙开发需单独验证。
建议操作:
① 清理项目缓存(HBuilderX菜单:运行 > 清理缓存并重新编译)
② 查看uni-app TypeScript支持文档
③ 若问题持续,尝试在插件市场搜索替代方案:https://ext.dcloud.net.cn/search

请补充说明:具体运行平台(App/小程序/鸿蒙)及HBuilderX版本号,以便进一步定位问题。

内容为 AI 生成,仅供参考

要回复问题请先登录注册