React version: 19.2
(This didn't reproduce on 19.1.1. Based on old reproduction hi-ogawa/react-router-templates@e6eddd0, it reproduced since at least 19.2.0-canary-19baee81-20250725.)
Steps To Reproduce
When serializing and deserializing certain objects with the same object reference as a property and as a prop, createFromReadableStream gets stuck.
import{renderToReadableStream}from"react-server-dom-xxx/server.edge";import{createFromReadableStream}from"react-server-dom-xxx/client.edge";asyncfunctiontest1(){// serialize same `obj` reference as top-level object and as propconstobj={};functionTest(_props: {obj: {}}){return"test";}constoriginal={obj: obj,node: <Testobj={obj}/>,}console.log("[original]",original);conststream=renderToReadableStream(original);console.log("[stream]",stream);constrestored=awaitcreateFromReadableStream(stream);// 👈 this gets stuckconsole.log("[restored]",restored);}Interestingly, it works if the order of properties are flipped, for example:
constoriginal={node: <Testobj={obj}/>,obj: obj,}This happens only on development. I initially observed this behavior on react-router remix-run/react-router#14085 and minimized a reproduction to the above pattern.
Link to code example:
The current behavior
createFromReadableStream gets stuck
The expected behavior
createFromReadableStream can deserialize stream
React version: 19.2
(This didn't reproduce on 19.1.1. Based on old reproduction hi-ogawa/react-router-templates@e6eddd0, it reproduced since at least 19.2.0-canary-19baee81-20250725.)
Steps To Reproduce
When serializing and deserializing certain objects with the same object reference as a property and as a prop,
createFromReadableStreamgets stuck.Interestingly, it works if the order of properties are flipped, for example:
This happens only on development. I initially observed this behavior on react-router remix-run/react-router#14085 and minimized a reproduction to the above pattern.
Link to code example:
The current behavior
createFromReadableStreamgets stuckThe expected behavior
createFromReadableStreamcan deserialize stream