-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
fix: The setStatus()
of the HMR module should not return an array, which may cause infinite recursion.
#17556
fix: The setStatus()
of the HMR module should not return an array, which may cause infinite recursion.
#17556
Conversation
For maintainers only:
|
setStatus()
of the HMR module should not return an array.setStatus()
of the HMR module should not return an array, which may cause infinite recursion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide reproducble example with the problem? I am not sure it is really fix the problem in right way
Take a look: https://github.com/System233/webpack-hmr-bug-replay.git |
Under certain |
I'm testing that PR because of random |
I'm actually facing this issue and this PR solved it for me. |
Sorry for delay and thank you |
Summary
🤖 Generated by Copilot at d293083
Fix unhandled promise rejections in
HotModuleReplacement.runtime.js
. Add an empty callback toPromise.all
insetStatus
to handle any status without handlers.The
setStatus()
of the HMR module should not return an array, which may cause infinite recursion.Related issues
Fixes #16972, #13857, #13876, #13877
Details
🤖 Generated by Copilot at d293083
Promise.all
insetStatus
to prevent unhandled rejections (link)PR #13576 Incorrectly makes the
setStatus
method in the HMR module return an array.webpack/lib/hmr/HotModuleReplacement.runtime.js
Lines 211 to 219 in e852415
before that:
webpack/lib/hmr/HotModuleReplacement.runtime.js
Lines 210 to 214 in 795b4b7
In the absence of
$hmrDownloadManifest$
, this array will be passed to the next then function, causing theif(!update)
condition to fail,webpack/lib/hmr/HotModuleReplacement.runtime.js
Lines 251 to 257 in e852415
resulting in infinite recursion in here:
webpack/hot/poll.js
Lines 13 to 24 in 1f99ad6
Furthermore, since
updatedModules
is an empty array, this code will endlessly print[HMR] Nothing hot updated.
to the console:webpack/hot/log-apply-result.js
Lines 26 to 28 in 1f99ad6