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

Codepen error #827

Closed
Vac1911 opened this issue Jan 29, 2021 · 3 comments
Closed

Codepen error #827

Vac1911 opened this issue Jan 29, 2021 · 3 comments

Comments

@Vac1911
Copy link

Vac1911 commented Jan 29, 2021

This imbedded codepen is producing an error.

Codepen: https://codepen.io/team/Vue/pen/76e344bf057bd58b5936bba260b787a8
Docs Location: https://v3.vuejs.org/guide/transitions-enterleave.html#cp_embed_76e344bf057bd58b5936bba260b787a8

image

Google Chrome - Version 88.0.4324.104 (Official Build) (64-bit)

@skirtles-code
Copy link
Contributor

I've done some preliminary investigation.

It seems this worked in 3.0.3 but is broken in 3.0.4 and 3.0.5.

Wrapping the <slot> in another element, such as a <div>, and moving the v-if to that element fixes it. However, that shouldn't be necessary.

filterSingleRoot is being passed null for its children argument. This comes from vnode.children in getChildRoot and the node that fails is the <img>. It isn't immediately clear to me why it needs to check the children of the <img> but either it needs to handle the null or the children need to be [].

I experimented a bit and it seems that the same problem can be reproduced with any empty element, it doesn't have to be an <img>. A empty <div> gave the same error. Putting any content in the <div> was enough for the error to go away.

@NataliaTepluhina
Copy link
Member

@Vac1911 thank you for reporting this! I've fixed a codepen with @skirtles-code recommended solution as a workaround.

@skirtles-code do you think this is rather a bug than a feature? Should we open an issue on core repo?

@skirtles-code
Copy link
Contributor

Done.

Closing this for now but we should probably switch it back once the bug is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants