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(hydration): vnode is of Text type and with empty text should be skipped when hydrateChildren #3246

Merged
merged 2 commits into from
Mar 26, 2021
Merged

fix(hydration): vnode is of Text type and with empty text should be skipped when hydrateChildren #3246

merged 2 commits into from
Mar 26, 2021

Conversation

HcySunYang
Copy link
Member

Fix: #3245

@HcySunYang
Copy link
Member Author

HcySunYang commented Feb 17, 2021

When a component just renders an empty string:

const Comp = { render: () => '' }

the ssr result is: nothing

the client rendering result is: Text Node

This causes hydration failure, it can be reproduced with the test case shown below:

  test('empty string', async () => {
    const Comp = { render: () => '' }
    // hydration failure
    mountWithHydration('<div></div>', () =>
      h('div', h(Comp))
    )
  })

This PR did not solve the above problem

@HcySunYang HcySunYang added the 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. label Mar 19, 2021
@yyx990803 yyx990803 merged commit 420c8f4 into vuejs:master Mar 26, 2021
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ssr] hydration error with comment and null value variable interpolation
2 participants