fix(vite): merge @radix-ui into react chunk to break load-order cycle (prod hotfix)#3204
Merged
Merged
Conversation
cloud.tangle.tools was hard-broken (`TypeError: Cannot read properties of undefined (reading 'forwardRef')`, only the purple background shell visible) because the post-#3199/#3203 rebuild produced this chunk graph: react-*.js ──imports `_getDefaultExportFromCjs` from──▶ radix-*.js radix-*.js ──top-level Qu.reduce → Yu → `i.forwardRef`──▶ react-*.js Rollup hoists the CJS-interop helper into whichever chunk happens to own the right modules under the current content-hash layout. On this build it landed in radix, so react imported it back, forming a cycle that crashed at module init: radix's top-level Primitive.* reduce ran before react's named exports were initialised. Fix: co-locate react/react-dom with @radix-ui in a single chunk. @radix-ui already depends on react, so they must evaluate in this order anyway — putting them together makes the chunk graph acyclic. Verified locally on both apps: - tangle-cloud: react chunk has zero cross-chunk imports → leaf - tangle-dapp: react chunk imports only from `noble` (also a leaf) - Both apps mount cleanly under preview with no pageerror events
✅ Deploy Preview for tangle-dapp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for tangle-cloud ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for tangle-leaderboard ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
drewstone
added a commit
that referenced
this pull request
May 14, 2026
… to master Promotes: - #3204 fix(vite): merge @radix-ui into react chunk to break load-order cycle - #3206 feat(tangle-cloud): wire dispute-bond claim flow (v0.15.0) - #3208 chore: retire `staging` branch, document develop → master flow This is the first non-cascade release after retiring the staging branch. From this point forward, every `[RELEASE]`-tagged commit on develop auto-promotes to master via auto-sync-master-with-develop.yml.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Production incident
`cloud.tangle.tools` is hard-broken right now:
```
TypeError: Cannot read properties of undefined (reading 'forwardRef')
at Yu (radix-TkqFv_GX.js:1:7237)
at Gu (radix-TkqFv_GX.js:1:6817)
at Array.reduce ()
```
Only the purple background shell mounts; `#root` stays empty.
Root cause
The post-#3199/#3203 rebuild produced a circular chunk graph:
```
react-.js ──imports _getDefaultExportFromCjs from──▶ radix-.js
radix-.js ──top-level Qu.reduce → Yu → i.forwardRef──▶ react-.js
```
Rollup hoists the CJS-interop helper into whichever chunk happens to own the right modules under the current content-hash layout. On this build it landed in radix, so react imported it back. radix's top-level `Primitive.*` reduce (which calls `forwardRef` for every primitive tag) ran before react's named exports were initialised → crash at module init.
This bug has been latent since #3185 (vendor chunk split). Content-hash-driven Rollup chunk shuffling exposed it on the ABI-sync rebuild. `tangle-dapp` has the same config and was one lucky chunk layout away from the same outage.
Fix
Co-locate `react` / `react-dom` with `@radix-ui` in a single chunk. `@radix-ui` already depends on react, so they must evaluate in this order anyway — putting them together makes the chunk graph acyclic.
Applied to both `apps/tangle-cloud/vite.config.ts` and `apps/tangle-dapp/vite.config.ts`.
Verification
Rollout
This needs the standard develop → staging → master cascade ASAP since prod is down.