Open
Description
Bug report
- [✅] I confirm this is a bug with Supabase, not with my own application.
- [✅] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
I made codes which uses Supabase client's channel by following the docs, but it always return the state 'CHANNEL_ERROR'.
To Reproduce
I couldn't find the exact conditions that cause the error. I'm just guessing that it happens in certain versions greater than 2.50.x.
Expected behavior
this.socket = new this.params.WebSocket(url, undefined);
AI said that 'undefined' makes 'Sec-WebSocket-Protocol: undefined' header, so connection was closed before hand-shaking. Just remove 'undefined' in WebSocket().
This temporary solution worked for me.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: Windows 10 Home
- Browser: chrome
- Version of @supabase/supabase-js: 2.50.2
- Version of Node.js: 20.17.57
Additional context
I got this solution from AI, and thought its solution a hallucination, but it worked. AI said that this error is solved in your internal branch, v2.53.1.