-
-
Notifications
You must be signed in to change notification settings - Fork 403
Open
Labels
bugSomething isn't workingSomething isn't working
Description
- I confirm this is a bug with Supabase, not my own application
- I’ve searched the Docs, GitHub Discussions, and Discord
🔍 Describe the Bug
In version 2.49.8 of @supabase/supabase-js, Realtime WebSocket connections fail in local development with this error:
WebSocket connection to ‘wss://<id>.supabase.co/realtime/v1/websocket?apikey=<key>&vsn=1.0.0’ failed: WebSocket is closed before the connection is established.
- ✅ The exact same code works in production
- ✅ It also works locally when using 2.49.1 or 2.49.7
- ❌ Fails consistently in local dev only when using 2.49.8 and 2.49.9
🧪 To Reproduce
- Subscribe to a postgres_changes channel in local dev:
supabase
.channel("credits-updates")
.on("postgres_changes", { event: "UPDATE", schema: "public", table: "user_profiles" }, () => {})
.subscribe();
- Load the page in http://localhost:5173 (Vite + React app)
- Observe the error in console
✅ Expected Behavior
The WebSocket connection should succeed and subscribe to the channel, just as it does in:
• Production environment
• Local dev using versions before 2.49.8
🖥️ System Info
• OS: macOS Sequoia 15.5
• Browser: Chrome 137
• Node.js: 22.14.0
• Package: @supabase/supabase-js@2.49.8
• Framework: Vite + React
• Frontend served over: http://localhost:5173
💬 Additional Context
Downgrading to @supabase/supabase-js@2.49.1 or 2.49.7 fixes the issue.
The problem appears isolated to local dev environments using Vite, but the backend setup and keys are correct.
prizalmarinez, magerags and AlejandroMora15
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working