Skip to content

Bug: RSC renderToReadableStream/createFromReadableStream gets stuck for certain objects on development #34751

Closed

Description

@hi-ogawa

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";

async function test1() {
  // serialize same `obj` reference as top-level object and as prop
  const obj = {};
  function Test(_props: { obj: {} }) {
    return "test";
  }
  const original = {
    obj: obj,
    node: <Test obj={obj} />,
  }
  console.log("[original]", original);
  const stream = renderToReadableStream(original);
  console.log("[stream]", stream);
  const restored = await createFromReadableStream(stream); // 👈 this gets stuck
  console.log("[restored]", restored);
}

Interestingly, it works if the order of properties are flipped, for example:

  const original = {
    node: <Test obj={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

Activity

  1. added a commit that references this issue on Oct 27, 2025
    bdeaf55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions