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

onLoad中的脚本错误,会导致小程序瘫痪 #9413

Closed
SSoLMan opened this issue May 27, 2021 · 1 comment
Closed

onLoad中的脚本错误,会导致小程序瘫痪 #9413

SSoLMan opened this issue May 27, 2021 · 1 comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@SSoLMan
Copy link

SSoLMan commented May 27, 2021

相关平台

微信小程序

复现仓库

https://github.com/SSoLMan/taro-error
小程序基础库: 2.17.0
使用框架: React

复现步骤

进入存在异常的页面触发错误, 然后返回访问其他页面

期望结果

单个页面异常不影响其他页面访问

实际结果

其他页面访问均出现异常(空白)

环境信息

Taro CLI 3.1.5 environment info:
    System:
      OS: Windows 7
    Binaries:
      Node: 12.16.0 - D:\Program Files\nodejs\node.EXE
      Yarn: 1.5.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 5.6.0 - D:\Program Files\nodejs\npm.CMD

补充信息

异常出现是,小程序原生的onLoad会触发,单子taro react组件的生命周期均不会触发

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

Chen-jj commented Jun 2, 2021

@SSoLMan 可以参考这个回答,使用错误边界包裹页面。

#8191 (comment)

@Chen-jj Chen-jj closed this as completed Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants