Describe the bug
Given is the situation, that a request from client for a rsc.x-component is answered with a 404 from the server.
This can happen in a proxied scenario with overlapping routes.
The code currently does not handle any case where !response.ok or !response.body exists.
Chrome shows the 404 error of the resource on the console and than hangs in an endless loop with a spinning loading symbol not reacting to any user input to stop the loading. Only entering the url input and loading an other page sometimes breaks the loop.
This problem does not exist in other browser: Safari, Firefox.
|
const component = createFromReadableStream( |
|
new ReadableStream({ |
|
type: "bytes", |
|
async start(controller) { |
|
let response; |
|
try { |
|
response = await fetch(srcString, { |
|
...options.request, |
|
method: options.method ?? (options.body ? "POST" : "GET"), |
|
body: options.body, |
|
headers: { |
|
...options.request?.headers, |
|
accept: "text/x-component", |
|
...(options.noCache && { "Cache-Control": "no-cache" }), |
|
...(options.prefetch && { "React-Server-Prefetch": "true" }), |
|
...options.headers, |
|
}, |
|
credentials: "include", |
|
signal: abortController?.signal, |
|
}); |
|
const { body } = response; |
|
|
|
window.dispatchEvent( |
Reproduction
No response
Steps to reproduce
- goto https://d1welhqlw2qcu2.cloudfront.net/client/client in a chrome browser
- klick on link with label
/client/client (dynamic static overlap) in footer
System Info
System:
OS: macOS 15.7.1
CPU: (12) arm64 Apple M4 Pro
Memory: 714.84 MB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 25.1.0 - /opt/homebrew/bin/node
npm: 11.6.2 - /opt/homebrew/bin/npm
pnpm: 9.15.5 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 141.0.7390.123
Firefox Developer Edition: 142.0
Safari: 26.0.1
Safari Technology Preview: 26.0
npmPackages:
@lazarv/react-server: workspace:^ => 0.0.0
@lazarv/react-server-adapter-aws-lambda: workspace:^ => 0.0.0
Used Package Manager
npm
Logs
No response
Validations
Describe the bug
Given is the situation, that a request from client for a rsc.x-component is answered with a 404 from the server.
This can happen in a proxied scenario with overlapping routes.
The code currently does not handle any case where
!response.okor!response.bodyexists.Chrome shows the 404 error of the resource on the console and than hangs in an endless loop with a spinning loading symbol not reacting to any user input to stop the loading. Only entering the url input and loading an other page sometimes breaks the loop.
This problem does not exist in other browser: Safari, Firefox.
react-server/packages/react-server/client/ClientProvider.jsx
Lines 681 to 703 in cfd997c
Reproduction
No response
Steps to reproduce
/client/client (dynamic static overlap)in footerSystem Info
System: OS: macOS 15.7.1 CPU: (12) arm64 Apple M4 Pro Memory: 714.84 MB / 48.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 25.1.0 - /opt/homebrew/bin/node npm: 11.6.2 - /opt/homebrew/bin/npm pnpm: 9.15.5 - /opt/homebrew/bin/pnpm Browsers: Chrome: 141.0.7390.123 Firefox Developer Edition: 142.0 Safari: 26.0.1 Safari Technology Preview: 26.0 npmPackages: @lazarv/react-server: workspace:^ => 0.0.0 @lazarv/react-server-adapter-aws-lambda: workspace:^ => 0.0.0Used Package Manager
npm
Logs
No response
Validations