1***@qq.com
1***@qq.com
  • 发布:2025-03-05 10:40
  • 更新:2025-03-06 11:46
  • 阅读:188

【报Bug】uniapp 创建vue3项目运行支付宝报错

分类:uni-app

产品分类: uniapp/小程序/阿里

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10家庭

HBuilderX类型: 正式

HBuilderX版本号: 3.99

第三方开发者工具版本号: 最新

基础库版本号: 最新

项目创建方式: HBuilderX

App下载地址或H5⽹址: 无法运行

示例代码:

无代码无关,底层编辑

操作步骤:

直接创建基础项目,支付宝运行就能浮现

预期结果:

复现

实际结果:

复现

bug描述:

uniapp,基础项目,未做任何修改,当vue2创建没有问题,vue3运行支付宝会报错

[APPX][Page] pages/index/index/0 CallMethod error Cannot read properties of undefined (reading '$vm')/TypeError: Cannot read properties of undefined (reading '$vm')
at getAppVm (http://127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7503:18)
at $createComponent (http://127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7507:26)
at createVueComponent (http://127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7718:10)
at Object.onLoad (http://127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7742:20)
at e.invokePublicMethod (https://appx/af-appx.worker.min.js:6:653700)
at e.invokePageEvent (https://appx/af-appx.worker.min.js:6:858211)
at e.performLifeHook (https://appx/af-appx.worker.min.js:6:727454)
at le (https://appx/af-appx.worker.min.js:6:8760)
at r.<computed> (https://appx/af-appx.worker.min.js:6:75829)
at le (https://appx/af-appx.worker.min.js:6:8760) 1741142124999
[APPX][Page] pages/index/index/0 CallMethod error Cannot read properties of undefined (reading '$callHook')/TypeError: Cannot read properties of undefined (reading '$callHook')
at Object.onShow (http://127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7747:18)
at e.invokePublicMethod (https://appx/af-appx.worker.min.js:6:653700)
at e.invokePageEvent (https://appx/af-appx.worker.min.js:6:858211)
at e.performLifeHook (https://appx/af-appx.worker.min.js:6:727454)
at le (https://appx/af-appx.worker.min.js:6:8760)
at r.<computed> (https://appx/af-appx.worker.min.js:6:75829)
at le (https://appx/af-appx.worker.min.js:6:8760)
at r.<computed> (https://appx/af-appx.worker.min.js:6:75829)
at le (https://appx/af-appx.worker.min.js:6:8760)
at r.<computed> [as performLifeHook] (https://appx/af-appx.worker.min.js:6:75829) 1741142125001
TypeError: Cannot read properties of undefined (reading '$vm')
at getAppVm (127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7503:18)
at $createComponent (127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7507:26)
at createVueComponent (127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7718:10)
at Object.onLoad (127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7742:20)
at e.invokePublicMethod (appx/af-appx.worker.min.js:6:653700)
at e.invokePageEvent (appx/af-appx.worker.min.js:6:858211)
at e.performLifeHook (appx/af-appx.worker.min.js:6:727454)
at le (appx/af-appx.worker.min.js:6:8760)
at r.<computed> (appx/af-appx.worker.min.js:6:75829)
at le (appx/af-appx.worker.min.js:6:8760)
TypeError: Cannot read properties of undefined (reading '$callHook')
at Object.onShow (127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7747:18)
at e.invokePublicMethod (appx/af-appx.worker.min.js:6:653700)
at e.invokePageEvent (appx/af-appx.worker.min.js:6:858211)
at e.performLifeHook (appx/af-appx.worker.min.js:6:727454)
at le (appx/af-appx.worker.min.js:6:8760)
at r.<computed> (appx/af-appx.worker.min.js:6:75829)
at le (appx/af-appx.worker.min.js:6:8760)
at r.<computed> (appx/af-appx.worker.min.js:6:75829)
at le (appx/af-appx.worker.min.js:6:8760)
at r.<computed> [as performLifeHook] (appx/af-appx.worker.min.js:6:75829)
[APPX][Page] pages/index/index/0 CallMethod error Cannot read properties of undefined (reading '$callHook')/TypeError: Cannot read properties of undefined (reading '$callHook')
at Object.onReady (http://127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7751:18)
at e.invokePublicMethod (https://appx/af-appx.worker.min.js:6:653700)
at e.invokePageEvent (https://appx/af-appx.worker.min.js:6:858211)
at e.performLifeHook (https://appx/af-appx.worker.min.js:6:727454)
at le (https://appx/af-appx.worker.min.js:6:8760)
at r.<computed> (https://appx/af-appx.worker.min.js:6:75829)
at le (https://appx/af-appx.worker.min.js:6:8760)
at r.<computed> (https://appx/af-appx.worker.min.js:6:75829)
at le (https://appx/af-appx.worker.min.js:6:8760)
at r.<computed> [as performLifeHook] (https://appx/af-appx.worker.min.js:6:75829) 1741142125014
[Runtime] Page(route=pages/index/index).onReady
TypeError: Cannot read properties of undefined (reading '$callHook')
at Object.onReady (127.0.0.1:51182/index.worker.js?hash=d3a00dbf&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51182%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:7751:18)
at e.invokePublicMethod (appx/af-appx.worker.min.js:6:653700)
at e.invokePageEvent (appx/af-appx.worker.min.js:6:858211)
at e.performLifeHook (appx/af-appx.worker.min.js:6:727454)
at le (appx/af-appx.worker.min.js:6:8760)
at r.<computed> (appx/af-appx.worker.min.js:6:75829)
at le (appx/af-appx.worker.min.js:6:8760)
at r.<computed> (appx/af-appx.worker.min.js:6:75829)
at le (appx/af-appx.worker.min.js:6:8760)
at r.<computed> [as performLifeHook] (appx/af-appx.worker.min.js:6:75829)

2025-03-05 10:40 负责人:无 分享
已邀请:
DCloud_UNI_OttoJi

DCloud_UNI_OttoJi - 日常回复 uni-app/x 问题,如果艾特我没看到,请主动私信

升级到 HBuilderX Alpha 最新版试一下,我测试 HBuilderX Alpha 4.52 表现正常

1***@qq.com

1***@qq.com (作者)

我有其他项目,那个项目升级4以上,一些依赖用不了,还没法升

  • DCloud_UNI_OttoJi

    HBuilderX 可以并行安装多个,你如果不想升级,可以区分某个项目有高版本,某个项目用低版本,你遇到的问题可能已经被修复了。

    2025-03-06 17:46

要回复问题请先登录注册