← All tasks
javascriptreact/react #35231Not a task: not reproduced

Bug: Build of `react-dom` hangs on Deno runtime

envgap__react__react-35231

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
0526c799d4df2815aed73912bfbd26fc0102ffc3
Manifest
packages/react-dom/package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

react/react #35231 · read the original issue
React version: 19.2.0

## Steps To Reproduce

1. clone https://github.com/Yovach/deno-tanstack-start-bug-reproduction
2. deno install
3. deno task build


## The current behavior

It's hanging forever.

## The expected behavior

Not hanging on `deno task build`


## Context

I've been investigating the vite build hanging issue in Deno and found the root cause. https://github.com/denoland/deno/issues/31248

Seems that `react-dom` package.json maps Deno to use the browser bundle (`server.browser.js`) instead of the node bundle. The browser bundle creates a MessageChannel for task scheduling, and this MessageChannel keeps Deno's process alive forever, causing the hang.
Runtime mappings:
  • Node.js → uses `setImmediate` from server.node.js (doesn't block exit) :white_check_mark:
  • Bun → uses `queueMicrotask` from server.bun.js (doesn't block exit) :white_check_mark:
  • Deno → uses `MessageChannel` from server.browser.js (blocks exit forever) :x:

## Solutions

Changing the "deno" mapping from `"./server.browser.js"` to `"./server.node.js"` at `node_modules/.deno/react-dom@19.2.0/node_modules/react-dom/package.json` fixed the hang.

I also tested changing the bun bundler to use server.browser.js, to have sure that this is the problem, and it hangs for bun too.

I talked with the Deno CLI team, and we decided to create this issue to check if make sense have a new bundle for Deno. For some reason, seems that solution was rejected in the past (https://github.com/facebook/react/pull/30655#issuecomment-2283099574) 

If it does not make sense again, we will need to add a special condition for `react-dom` on Deno side. 

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]