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

fix(hmr): avoid infinite recursion when reloading hmr components (#6930) #6936

Merged
merged 4 commits into from
May 31, 2024

Conversation

zhangzhonghe
Copy link
Member

fix #6930


// #6930 avoid infinite recursion when reloading hmr components
if (__DEV__ && hmrDirtyComponents.has(instance.type)) {
hmrDirtyComponents.delete(instance.type)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!
I feel we should delete the dirty component here:

queueJob(instance.parent.update)

change the code as blow:

queueJob(() => {
  instance.parent.update()
  hmrDirtyComponents.delete(oldComp)
})

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the suggestion!

@zhangzhonghe zhangzhonghe force-pushed the fix-6930 branch 2 times, most recently from 5392bfd to ebea034 Compare October 25, 2022 03:16
@haoqunjiang haoqunjiang added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. ready for review This PR requires more reviews labels May 29, 2024
@yyx990803 yyx990803 merged commit 36bd9b0 into vuejs:main May 31, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. ready for review This PR requires more reviews
Projects
Development

Successfully merging this pull request may close these issues.

Maxiumum call stack happens on HMR with :ref="setElement" and editing that component
4 participants