Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信小程序报错 TypeError: t.$callHook is not a function #4781

Open
bxm0927 opened this issue Mar 19, 2024 · 1 comment
Open

微信小程序报错 TypeError: t.$callHook is not a function #4781

bxm0927 opened this issue Mar 19, 2024 · 1 comment
Labels
bug Something isn't working mp-weixin 微信小程序

Comments

@bxm0927
Copy link

bxm0927 commented Mar 19, 2024

问题描述
Vue3微信小程序,发行打包时选择【发行为混合分包】,然后将打包后对应目录文件拷贝至已有原生微信小程序中。
项目运行时,在 uni-app 页面中对小程序做 切前台/切后台 操作,控制台有报错:TypeError: t.$callHook is not a function
image

image

复现步骤

  1. 使用 HBuilder X 最新 alpha 版本和 vue 3 创建一个示例小程序工程
  2. 发行打包时选择【发行为混合分包】
  3. 然后将打包后对应目录文件拷贝至已有原生微信小程序中
  4. 运行小程序,打开uni-app页面
  5. 执行 切前台/切后台 操作,观察控制台有报错

预期结果
控制台无报错

实际结果
控制台报错,App.onLaunch 等方法未触发

系统信息

发行平台: 微信小程序
操作系统:双端
HBuilderX版本 3.98
uni-app版本 3.0.0-3081220230817001

补充信息
报错信息在源码的这个位置,vm.$callHook 为 undefined 导致的报错,初步猜测是 initCreateSubpackageApp 的 bug
image

image
@linzhenjie
Copy link

linzhenjie commented Jul 10, 2024

该报错 会影响 wx.chooseImage api 使用。 看看加急修复。

@bfc846958672 bfc846958672 added mp-weixin 微信小程序 bug Something isn't working labels Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mp-weixin 微信小程序
Projects
None yet
Development

No branches or pull requests

3 participants