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

This issue has been created since 2022-10-24.

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

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> 
cjy926 wrote this answer on 2022-11-21

try

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-12-10
Star Count 201155
Watcher Count 6070
Fork Count 33134
Issue Count 595

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
[Feature Request]: Horizontal-only (or vertical-only) tiling 4 2022-10-20 2022-10-14
[BUG] immich-web stopped working with 1.20.0 on NixOS 2 2022-08-07 2022-09-01
configurable pop3 capabilities 0 2022-04-03 2022-12-01
yolov7-w6 :IndexError: list index out of range 3 2022-11-10 2022-11-28
Pixel coordinates in Instance segmentation 0 2022-11-10 2022-11-28
ray_ground_filter crashes on empty clouds 0 2021-01-28 2022-11-20
Create an Electron.js desktop deployment for Tezori3 PoC 0 2022-05-13 2022-10-28
Having trouble getting adwm-git, from the Arch User Repository, to compile. 2 2021-11-18 2022-09-30
Simplify Liquid Configuration implementation and injection 1 2021-05-12 2022-10-01
Add alignment (and minWidth?) to `bordered` 1 2021-12-27 2022-10-27
Listener frequently added but not triggered 17 2020-07-15 2022-07-27
can't save Bolinger Band return values or supertend return values 3 2021-09-10 2022-10-15
Invite new user work anymore 7 2022-04-05 2022-09-17
<Scripts crossOrigin /> doesn't work for when hosting the app's JS assets on a different CDN server 4 2022-06-25 2022-11-13
Multi process - Bring dialog box on top 1 2021-05-29 2022-10-04
How to disable warning dialog "DNS server address is not a public address" 2 2021-01-30 2022-11-27
Roll Back to earlier version. SD Card Checks before install. 21 2021-07-03 2022-10-01
导出 Word 时支持通过属性设置 Pandoc 参数 5 2021-11-30 2022-10-22
Functional improvement on decodeFirstFrame 0 2021-08-21 2022-11-06
JS4 : iobroker multihost enable Fehler TypeError: dbTools.isLocalObjectsDbServer is not a function 3 2022-02-04 2022-07-22
WhatsApp Buttons 55 2020-02-05 2022-01-09
FreeBSD Support (host) 16 2022-06-08 2022-11-15
odysee.com: breakage 3 2022-02-22 2022-09-20
Add precision-recall-gain AUC 2 2020-09-21 2022-11-22
Low responsiveness if started in RDP session 2 2022-01-11 2022-10-21
Update Emacs to HEAD of master 3 2019-05-16 2022-10-08
How to run this on EKS cluster ? 0 2022-02-18 2022-10-24
luv_unix is missing from opam-repository 8 2021-07-23 2022-11-13
Admin redirect does not function well 4 2021-12-24 2022-12-03
change package to cn.polarismesh 0 2021-12-14 2022-12-04
add ref to https://www.w3.org/TR/dx-prof-conneg/ (with warning about SPARQL protocol) 1 2021-05-28 2022-12-03
Update to latest Sentry SDKs 5 2021-02-10 2022-10-27
Operation not permitted error 1 2022-01-12 2022-12-01
git merge doesn't completely work with fish 0 2021-09-02 2022-10-14
Godot 3.4.3 does not load on Windows 11 (expired signature) 8 2022-02-26 2022-09-15
Selecting Placeholders for Keyboard 1 2021-09-02 2022-10-27
Dashboad breaks emacsclient when used in conjuction --with-native-compilation 4 2021-10-22 2022-11-19
Unable to use Masked URL Redirect to loca.lt 4 2021-11-22 2022-12-07
dotenv run breaks out of venv on windows 7 2020-03-16 2022-11-18
Dependency Dashboard 0 2021-08-30 2022-10-29
[bug] Texturing node errors with no error message in logs when given mesh - did not occur in prior 2020 release 2 2021-06-11 2022-12-09
Labels on function decorator that are defined at runtime 0 2021-09-08 2022-10-26
cpe_osquery && osquery.conf && scheduled queries 1 2021-01-27 2022-11-28
Configure tasks plaso and run_csv_jsonl Opensearch to use flush interval 1 2022-09-04 2022-10-27
Remove unnecessary casting from Clone() methods 6 2021-02-21 2022-12-02
Support returning strings 5 2018-10-27 2022-12-04
fzf-tmux from $PATH is ignored when using the vim plugin 2 2021-06-11 2022-11-12
Suggestion: optional interface 15 2014-08-06 2022-10-09
awesome-tab 在 Emacs 29.0.50 打开 git 仓库下的文件报错 5 2022-06-14 2022-12-09
Icons aren't rendered in Chromium browser 1 2020-10-15 2022-11-26