Repository navigation
Description
What happened
The v1.16.0 iOS build (8af7b052, build 11201) failed at the EAGER_BUNDLE phase:
Error: Node.js detected but native WebSocket not found.
Suggested solution: Ensure you are running Node.js 22+ or provide a WebSocket
implementation via the transport option.
at getWebSocketConstructor (@supabase/realtime-js/dist/main/lib/websocket-factory.js:86)
at new RealtimeClient
at SupabaseClient._initRealtimeClient
at createClient
at packages/scf-core/utils/supabase/client.ts:52
…
at getBuildTimeServerManifestAsync (@expo/router-server/build/static/getServerManifest.js:23)
Why
@supabase/supabase-js 2.110's bundled realtime-js requires a native WebSocket global when it detects Node. Expo Router calls createClient under Node while generating the build-time route manifest (packages/scf-core/utils/supabase/client.ts is reached from useUser → useProtectedRoute → app/(admin)/_layout.tsx).
apps/scaffald/eas.json pins the production profile to "node": "20.19.4". Node 20 has no global WebSocket (it landed unflagged in Node 22). So the manifest generation throws and the bundle phase dies.
It passes locally, which is the trap: local Node is 22.x, where WebSocket is a global. Pods, typecheck, unit tests, and the web export were all green — the web bundle never exercises this path the same way.
Reproduced deterministically without needing a Node 20 install:
delete globalThis.WebSocket
const { createClient } = await import('@supabase/supabase-js')
createClient('https://example.supabase.co', 'anon-key')| supabase-js | result |
|---|---|
| 2.110.9 | throws Node.js detected but native WebSocket not found. |
| 2.86.2 | OK |
Immediate action
Reverted @supabase/supabase-js to ~2.86.0 in both the catalog and the pnpm override, with a comment on the catalog entry pointing here. Dependabot will try to bump it again — that is what this issue is for.
To actually unblock the upgrade, pick one
- Raise the EAS builder Node to 22.x in
eas.json(production, and the other profiles for consistency). Cleanest — Node 22 is current LTS — but it changes the build toolchain and deserves its own build to validate. - Pass a
transporttocreateClientinpackages/scf-core/utils/supabase/client.tsso realtime never reaches for a global. Narrower, and makes the client independent of the runtime's WebSocket support. - Don't construct the client at module scope on a path expo-router loads at build time — lazy-init it. Arguably the most robust, since it stops build-time manifest generation from touching runtime clients at all.
Option 2 or 3 is probably right regardless; 1 alone leaves the same landmine for the next runtime that lacks WebSocket.
Also worth fixing: these logs are readable
The EAS logFiles URL is brotli-encoded NDJSON, not the opaque blob it appears to be (file reports data, and gzip/zstd/xz all fail). brotli -dc < log.bin yields one JSON object per line with a phase and msg, which is how the stack trace above was recovered without the dashboard. Worth writing down — the prevailing assumption has been that EAS build errors can only be read in the browser.
Activity
fix(deps): pin @supabase/supabase-js back to 2.86 — 2.110 breaks the …
fix(scf-core): lazy-init the Supabase client; run the EAS builder on …
thinkclay commentedon Jul 30, 2026
Both halves landed in #516 and proven against supabase-js 2.110.9 with a local
export:embed --eagerharness (eager client fails with the exact WebSocket error, lazy client passes; same deps, same stripped runtime). Key discovery for future debugging: plainexpo export --platform iosdoes NOT run the failing 'Exporting server' step —export:embed --eageris what EAS runs. The ~2.86 pin now waits only on runtime validation of the 2.86→2.110 auth/realtime surface. A no-submit production-profile build is validating the Node 22 toolchain on the real builder.thinkclay commentedon Jul 30, 2026
Node 22 toolchain confirmed on the real builder: production-profile validation build
74e0b6bb(v1.16.1 / 11203, commit5513577, no submit) FINISHED in 7m11s — through EAGER_BUNDLE, the phase that killed 11201. The builder-side half of this issue is fully validated end to end. Remaining follow-up lives on the catalog note: runtime-validate the supabase-js 2.86→2.110 auth/realtime surface in its own PR, which is now safe to attempt.chore(deps): batch dependabot #550, #551, #619, #641, #642 — and unbl…
chore(deps): batch dependabot #550, #551, #619, #641, #642 — and unbl…