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

升级3.3.0 后 小程序分享朋友圈打开后 报错 initNativeApi #9899

Closed
xiehui999 opened this issue Jul 27, 2021 · 13 comments · Fixed by #9954, #9967 or #9972
Closed

升级3.3.0 后 小程序分享朋友圈打开后 报错 initNativeApi #9899

xiehui999 opened this issue Jul 27, 2021 · 13 comments · Fixed by #9954, #9967 or #9972
Assignees
Labels
F-react Framework - React P-1 High, patch T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@xiehui999
Copy link

相关平台

微信小程序

复现仓库

https://github.com/xiehui999/test
小程序基础库: 2.18.1
使用框架: React

复现步骤

随便初始化一个demo, 页面config 增加 enableShareAppMessage: true,
enableShareTimeline: true, 开启分享功能, 分享朋友圈打开后,报错。

期望结果

正常打开

实际结果

无法正常打开

环境信息


👽 Taro v3.3.0


  Taro CLI 3.3.0 environment info:
    System:
      OS: macOS 10.15.4
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.18.3 - /usr/local/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 6.14.6 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 3.3.0 => 3.3.0 
      @tarojs/mini-runner: 3.3.0 => 3.3.0 
      @tarojs/react: 3.3.0 => 3.3.0 
      @tarojs/runtime: 3.3.0 => 3.3.0 
      @tarojs/taro: 3.3.0 => 3.3.0 
      @tarojs/webpack-runner: 3.3.0 => 3.3.0 
      babel-preset-taro: 3.3.0 => 3.3.0 
      eslint-config-taro: 3.3.0 => 3.3.0 
      react: ^17.0.0 => 17.0.2 
      react-native: 0.63.2 => 0.63.2 

补充信息

升级3.3.1同样有问题, 之前使用的是3.2.10 是work的

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Jul 27, 2021
@luckyadam
Copy link
Member

Taro 3.3.1
image
没有复现

@xiehui999
Copy link
Author

xiehui999 commented Jul 27, 2021

真机分享朋友圈, 打开分享的内容

@luckyadam
Copy link
Member

真机依然没有复现

@xiehui999
Copy link
Author

怎么可能, 我试了几个手机都必现的, 是点的分享到朋友圈的内容? 直接打开时正常的

打开小程序-右上角- 分享到朋友圈
打开朋友圈非内容报错。 其它打开方式正常

@luckyadam
Copy link
Member

麻烦升级到 3.3.1 再尝试

@xiehui999
Copy link
Author

升级3.3.1 尝试
image

@luckyadam
Copy link
Member

1627386445387412.mp4

@luckyadam
Copy link
Member

麻烦删掉依赖重装试试吧

@xiehui999
Copy link
Author

那就很奇怪了,我用了两台Mac 上试过,直接初始化demo都会有这个错。 我试着删除全局cli 重新装, 都报错,降级回3.2.10就可以, yarn.lock , node_modules 都删除试了,还是错

@xiehui999
Copy link
Author

xiehui999 commented Jul 27, 2021

问题定位:
小程序基础库2.18.0 开始增加 lanDebug, 这个在朋友圈是没有权限的,会报错, 所以你打开正常应该基础库是2.18.0 以前的版本
shared/dist/shared.esm.js 文件中 lanDebug 不支持朋友圈里打开,

const apis = Object.keys(global).filter(api => preserved.indexOf(api) === -1 && api!=='lanDebug');

把这个lanDebug 过滤掉或者catch下就work了, 这里面逻辑要加trycatch
taro 3.2.10 是正常的,应该之前taor initapi 有try、catch逻辑

@axu6705
Copy link

axu6705 commented Jul 28, 2021

1627386445387412.mp4

分享是没有问题的,看你的视频,从朋友圈进入的页面白屏了,这是有问题的。
@luckyadam

@Chen-jj Chen-jj added the P-1 High, patch label Jul 28, 2021
@taro-bot2 taro-bot2 bot added this to the 3.3.2 milestone Jul 28, 2021
@Chen-jj Chen-jj self-assigned this Jul 28, 2021
@axu6705
Copy link

axu6705 commented Aug 2, 2021

@Chen-jj 请问什么时候发版修复。

@Chen-jj
Copy link
Contributor

Chen-jj commented Aug 2, 2021

@axu6705 本周内

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React P-1 High, patch T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
4 participants