We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
字节跳动小程序
https://github.com/Jemair/taro-catch 小程序基础库: 1.24.0.2 使用框架: React
显而易见 使用默认脚手架生成的项目也存在该问题
在 componentDidCatchError 捕获到错误并输出到 console
componentDidCatchError 无法捕获到错误
$ taro info 👽 Taro v3.0.15 Taro CLI 3.0.15 environment info: System: OS: macOS 10.15.7 Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.18.4 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 6.14.9 - ~/.npm-global/bin/npm npmPackages: @tarojs/components: 3.0.15 => 3.0.15 @tarojs/mini-runner: 3.0.15 => 3.0.15 @tarojs/react: 3.0.15 => 3.0.15 @tarojs/runtime: 3.0.15 => 3.0.15 @tarojs/taro: 3.0.15 => 3.0.15 @tarojs/webpack-runner: 3.0.15 => 3.0.15 babel-preset-taro: 3.0.15 => 3.0.15 eslint-config-taro: 3.0.15 => 3.0.15 react: ^16.10.0 => 16.14.0
在这个 issue 中同样提到这个问题 #7952 看起来在微信小程序中也存在同样问题
The text was updated successfully, but these errors were encountered:
参考这个回复吧,页面级别的报错这样处理:#8191
Sorry, something went wrong.
所以我可以理解成 pages 已经是最上层,其实 app.tsx 只是简单转换成了小程序的 app.js ?
参考上面的 issue 已经捕获到错误
参考这个回复吧,页面级别的报错这样处理:#8191 所以我可以理解成 pages 已经是最上层,其实 app.tsx 只是简单转换成了小程序的 app.js ?
不是,Page 成为错误边界后,它自己的错误是由上层处理的,它自己的 componentDidCatch 捕获不到该错误,详情可参考 React 文档错误处理部分。
componentDidCatch
No branches or pull requests
相关平台
字节跳动小程序
复现仓库
https://github.com/Jemair/taro-catch
小程序基础库: 1.24.0.2
使用框架: React
复现步骤
显而易见
使用默认脚手架生成的项目也存在该问题
期望结果
在 componentDidCatchError 捕获到错误并输出到 console
实际结果
componentDidCatchError 无法捕获到错误
环境信息
补充信息
在这个 issue 中同样提到这个问题 #7952 看起来在微信小程序中也存在同样问题
The text was updated successfully, but these errors were encountered: