Skip to content

Missing scripts during streaming #7349

@roduyemi

Description

@roduyemi

Which project does this relate to?

Start

Describe the bug

If we defer loader data and serialisation finishes before the HTML stream is processed, the resolved data and the stream end marker ($_TSR.e()) are never injected into the HTML.

Complete minimal reproducer

https://github.com/roduyemi/missing-streaming-scripts

Steps to Reproduce the Bug

pnpm install && npx playwright install chromium
pnpm test:bug
pnpm test:fix

Expected behavior

$_TSR.e() and all deferred data should be present in the SSR response regardless of whether serialisation completes before or during HTML streaming.

Screenshots or Videos

No response

Platform

  • Router Version: 1.169.2
  • Start Version: 1.167.64
  • OS: macOS
  • Browser: Chromium
  • Bundler: Vite 8.0.10
  • Runtime: Cloudflare Workers (wrangler dev)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions