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(core): fix sameVnode for async component #11107

Merged

Conversation

contribu
Copy link

@contribu contribu commented Feb 14, 2020

I found and fixed a vdom bug related to async component and SSR.
I originally noticed this bug on my closed project using Nuxt.
The minimal reproduction code is included in test.

Phenomenon

Throw when hydrated pending async component is patched by v-if="false" node.
(version: 2.6.11)

Cause

  1. v-if="false" node is represented by comment node
  2. sameVNode returns true when asyncPlaceholder and comment are compared.
  3. patchVNode executed for asyncPlaceholder and comment.
  4. comment doesn't have asyncFactory but asyncFactory.resolved is accessed.

Fix

Fix sameVNode to return false when asyncPlaceholder and comment are compared.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@Evertvdw
Copy link

Evertvdw commented Mar 4, 2020

We are running into this issue as well, can this be reviewed @yyx990803 ?

@posva posva added the bug label Mar 4, 2020
@Evertvdw
Copy link

Just ran into this again, would love for this to be merged!

@Evertvdw
Copy link

Will this get included anytime soon?

@posva posva added this to Guidance Needed in 2.6.13 Feb 24, 2021
Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

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

Thanks!

@posva posva merged commit 5260830 into vuejs:dev Apr 16, 2021
@posva posva moved this from Guidance Needed to Done in 2.6.13 Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants