-
Notifications
You must be signed in to change notification settings - Fork 50.2k
fix(react-dom): use server.node.js for Deno to prevent build hangs (#35231) #35247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(react-dom): use server.node.js for Deno to prevent build hangs (#35231) #35247
Conversation
|
Hi @Garvitpant777! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
When using react-dom/server in Deno (e.g. during SSR/pre-rendering with Vite, esbuild, Rollup, TanStack Start, etc.), the current conditional export maps the deno condition to server.browser.js. That file creates a MessageChannel for task scheduling. In Deno, an open MessageChannel port prevents the process from exiting, causing bundlers to hang forever. FixChange the Deno condition to use the Node.js server bundle instead:
server.node.js uses setImmediate (fully supported and non-blocking in Deno) instead of MessageChannel, so the process exits cleanly. Impact Instantly fixes indefinite hangs for all Deno users performing SSR/pre-rendering builds Reproduction & Verification ✔ 62 modules transformed. Closes #35231
@acdlite @sebmarkbage @lunaruan @bvaughn @trueadm @eps1lon @fraidev @Yovach Please check this out...
|
Hi, a user already provided a PR here : #35235 |
With due respect would you please merge my solution if it seems a good fit to you ... Thank You |




When using
react-dom/serverin Deno (e.g. during SSR/pre-rendering with Vite, esbuild, Rollup, TanStack Start, etc.), the current conditional export maps the deno condition toserver.browser.js.That file creates a
MessageChannelfor task scheduling. In Deno, an openMessageChannelport prevents the process from exiting, causing bundlers to hang forever.Fix
Change the Deno condition to use the Node.js server bundle instead: