Skip to content

Bug: Suspense fallback streaming not working without html/body/head components #35327

@HenriqueLimas

Description

@HenriqueLimas

Suspense fallback is not rendered during SSR when the root component lacks top-level <html>, <head>, or <body> tags. The server buffers the entire response until all suspended promises resolve, preventing streaming and the rendering of the initial fallback content.

This behavior impacts a use case where the React component is rendered as a sub-tree to be integrated into a larger application that uses a different framework.

This commit introduced this behavior change in the streaming logic where it worked in 19.0.0.

React version: 19.1-19.2

Steps To Reproduce

  1. Access https://3c4mqn-8080.csb.app/no-streaming

The current behavior

The server renders the component's final output without showing the fallback. The generated HTML for the suspended component only contains the resolved content wrapped in the standard suspense boundary markers:

<!--$--><h1>Hello</h1><!--/$-->

No fallback content (i.e., the "Loading..." message) is rendered to the client.

The expected behavior

TheLoading... fallback should be rendered, mirroring the correct behavior observed in the full-document rendering path:

<!--$-->
<!--$?-->
<template id="B:0"></template>
Loading...
<!--/$-->
<!--/$-->
<script id="_R_">
  ...
</script>
<div hidden id="S:0">
  <h1>Hello</h1>
</div>
<script>
  ...
</script>

Comparison Path: https://3c4mqn-8080.csb.app/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions