Debug streaming SSR (Pro)
Streaming SSR is a React on Rails Pro workflow. Read the version-matched package guide before changing code.
- Run
bin/rails react_on_rails:doctor FORMAT=jsonand fix setup errors first. - Identify the exact helper before applying streaming prerequisites.
Progressive helpers
For stream_react_component, cached_stream_react_component, and
stream_react_component_with_async_props:
- Confirm the controller includes
ReactOnRailsPro::Stream, the action callsstream_view_containing_react_components, and the Node renderer is healthy. - When Suspense content should reveal progressively, confirm the boundary's child actually suspends.
- For
stream_react_component_with_async_propsonly, confirmReactOnRailsPro.configuration.enable_rsc_supportis enabled by settingconfig.enable_rsc_support = truein the Pro initializer. This is not a prerequisite forstream_react_componentorcached_stream_react_component. - For async props, keep slow work inside the streaming block, emit JSON-serializable values, and ensure every requested prop is emitted or rejected.
Buffered helpers
For buffered_stream_react_component, cached_buffered_stream_react_component, and
cached_static_rsc_component:
- Confirm the Node renderer is healthy and inspect the complete buffered result.
- These helpers do not require the streaming controller wrapper: they do not require
ReactOnRailsPro::Stream,stream_view_containing_react_components, or a suspending boundary. - For
cached_static_rsc_component, setconfig.enable_rsc_support = true; disabling RSC support omits the RSC payload generation that gives this helper its static-RSC behavior. This setting is not a prerequisite forbuffered_stream_react_componentorcached_buffered_stream_react_component. - Do not expect early shell flush or progressive Suspense reveal from a buffered helper.
Debug either path
- Observe the response with an unbuffered client and compare origin behavior with the proxy/CDN path. Check compression and buffering configuration before changing React code.
- Correlate Rails logs, Node renderer logs, response chunks, and browser timing marks; fix one demonstrated boundary at a time and rerun the same probe.
Hosted streaming docs are a secondary reference: https://reactonrails.com/docs/pro/streaming-ssr.