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

vconsole无法捕获 DOMContentLoaded 事件之前发生的 js error #586

Open
coolriver opened this issue Nov 30, 2022 · 1 comment
Open

Comments

@coolriver
Copy link

vConsole Version: 3.10.0+

在移动端调试时,有时候页面的主 js bundle 里有兼容性问题的 js 执行报错了。这个时候,即使在页面最前面引用 vconsole 脚本并初始化,也捕获不到主 js bundle 里的 js 错误。(这个错误对于移动端调试很关键,能帮助找到哪行代码有兼容问题。)

image

看代码里,发现 bindErrors 是在 onReady 后才做的,也就是 DOMContentLoaded 事件触发后。所以无法捕获到在此之前发生的 js error。

(在 3.10.0 之前的版本,没有这个问题。)

@Maizify
Copy link
Collaborator

Maizify commented Jun 1, 2023

3.3.4开始改成在window DOMContentLoaded之后来加载vConsole,有些年头了。总会有这种时序问题的,暂时没什么特别好的办法,我再想想。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants