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

Invalid HTML during SSR if async component fails to load / Error component from Dynamic Components is not used during SSR #12848

Open
brunomperes opened this issue Oct 24, 2022 · 0 comments

Comments

@brunomperes
Copy link

brunomperes commented Oct 24, 2022

Version

2.7.13

Reproduction link

replit.com

Steps to reproduce

  1. Open replit link above.
  2. Click Run.
  3. Notice that the outputted HTML from renderToString() is invalid (it's missing a </div> and the remainder of the template after AsyncComp).

Or if you want to reproduce locally:

  1. Declare a Dynamically Loaded component with an Async Factory function
  2. Make the component load promise be rejected
  3. Notice the output HTML is interrupted wherever the Async Component is used in the template

Notice that the HTML

What is expected?

Error component declared in the async factory would be picked up when the async component fails to load during SSR.

Expected output (of the replit linked):

<app data-server-rendered="true"><div>I always render</div> <p>An error happened during SSR</p> <div>I won't render if AsyncComp rejects</div></app>

What is actually happening?

HTML rendering is interrupted where the async component fails to load, generating invalid HTML

This string is being outputted:

Actual output (of the replit linked):

<app data-server-rendered="true"><div>I always render</div> 
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

1 participant