Skip to content

fix: pass deferRegistry to renderHTML during SSR#63

Merged
uhyo merged 2 commits intomasterfrom
fix/ssr-defer-registry
Feb 18, 2026
Merged

fix: pass deferRegistry to renderHTML during SSR#63
uhyo merged 2 commits intomasterfrom
fix/ssr-defer-registry

Conversation

@uhyo
Copy link
Owner

@uhyo uhyo commented Feb 18, 2026

Summary

  • Fix DeferredComponent crash during SSR by passing deferRegistry to renderHTML() in both dev SSR and build paths
  • Add e2e test fixture with SSR + defer() to prevent regression
  • Gitignore playwright-report-dev/ directory

Details

When SSR is enabled and a deferred component (created via defer()) is rendered, DeferredComponent crashes because renderEntryToResponse() and build() in rsc/entry.tsx never passed deferRegistry to ssrEntryModule.renderHTML(). The SSR entry wraps the tree in <RegistryContext value={options.deferRegistry}>, but since deferRegistry was never passed, the context was undefined. When DeferredComponent renders during SSR, it saw no registry and fell through to the client-side fetch() path, which fails because relative URLs have no base on the server.

Test plan

  • pnpm build succeeds
  • pnpm test:e2e — 19 passed (including 2 new ssr-defer tests)
  • pnpm test:e2e:dev — 19 passed (including 2 new ssr-defer tests)

🤖 Generated with Claude Code

uhyo and others added 2 commits February 18, 2026 23:48
DeferredComponent crashed during SSR because deferRegistry was never
passed to ssrEntryModule.renderHTML(), causing the RegistryContext to be
undefined and the component to fall through to a client-side fetch path
that fails on the server.

Add e2e test fixture with SSR + defer() to prevent regression.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@uhyo uhyo merged commit a7a46e4 into master Feb 18, 2026
1 check passed
@uhyo uhyo deleted the fix/ssr-defer-registry branch February 18, 2026 14:53
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

Successfully merging this pull request may close these issues.

1 participant

Comments