Tencent / vConsole

A lightweight, extendable front-end developer tool for mobile web page.
Other
16.86k stars 2.95k forks source link

vConsole 导致 react 的热更新失败 #496

Closed ywwhack closed 2 years ago

ywwhack commented 2 years ago

vConsole Version: 3.11.0

报错信息如下:

image

在报错的地方,打个断点,捕获到的信息如下:

image

ywwhack commented 2 years ago

看了下源码,应该是 https://github.com/Tencent/vConsole/commit/dbd7765ebf80b273359cf5186e8b6b5871c2ff0a#diff-a0e64af60dc13dd969ec645277aa2b6b6b9dfc47a9ebe7ef6b240b73daa51605R308 这行代码导致的报错

ike666666 commented 2 years ago

https://github.com/Tencent/vConsole/blob/3165e627af43c24d8670527f1d7943a57ebf0e2a/src/network/network.model.ts#L309 是这一行导致的,第二个参数是非必要的,但是代码不严谨没做判断,正常ts会检测出来的。 让作者加个?号就可以了,init?.body

Maizify commented 2 years ago

感谢反馈,已在 #500 中修复,预计在3.11.1中发布。