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

SSR: missing class and style attributes with async components #11837

Open
realityfilter opened this issue Dec 21, 2020 · 3 comments
Open

SSR: missing class and style attributes with async components #11837

realityfilter opened this issue Dec 21, 2020 · 3 comments

Comments

@realityfilter
Copy link

realityfilter commented Dec 21, 2020

Version

2.6.11

Reproduction link

https://github.com/realityfilter/bugreport-dynamic-components-ssr

https://replit.com/@posva/vuejsvue11837

Steps to reproduce

  • run

What is expected?

<app data-server-rendered="true"><div class="child parent app"></div> <div class="child async parent app"></div></app>

What is actually happening?

<app data-server-rendered="true"><div class="child parent app"></div> <div class="child async parent"></div></app>

There are some workarounds for this issue:

  • avoiding async components via manual registering the components in a plugin
  • wrapping the DynamicComponent with a div
@realityfilter
Copy link
Author

The incorrect DOM looks like:

ssr-dom

@yshrsmz
Copy link

yshrsmz commented Mar 5, 2021

I'm having the same issue.

when manually bind $attrs like below, it seems to render attributes while SSR.
but I can't render class and style for some reason

<component is="SomeComponent v-bind="$attrs" />

@pi0
Copy link
Contributor

pi0 commented Mar 31, 2021

I've managed to create bare minimum reproduction: https://replit.com/@pi0/vuejsvue11837#index.js

Even without dynamic components, an async component fails to inherit a class from the two-level upper parent (check the difference between <child> and <async-child> classes).

Once made a fix PR can ensure these two issues are the same (root cause) but my guess is they are.

@posva posva changed the title SSR: missing class and style attributes with dynamic async components SSR: missing class and style attributes with async components Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants