Supabase realtime not working!
See original GitHub issueBug report
Describe the bug
The realtime feature of supabase is not working.
I am able to insert, delete etc. But just the “realtime” feature is not working for me.
What I’ve done
- enabled replication for all tables
- disabled rls for all tables
- tried with sveltekit and react
- tried 3 different browsers (chrome, brave, firefox)
Supabase is responding with 403 Forbidden
response, and I don’t know why. Also, there don’t seem to be any error message in the response to debug or to know what exactly is causing the issue.
Is there a way in @supabase/supabase-js
to get the error object on subscription?
I have tried try catch
but the error is not going to catch
block.
Also, I’ve tried .onError()
, which is indeed running the callback function, but it doesn’t have access to error object.
The callback on .subscribe()
is running sometimes, but simultaneously, the error is also running. But most of the time, only the error is occurring.
To Reproduce
Just copy this code, and try it yourself.
const supabase = createClient(
'SUPABASE URL HERE',
'SUPABASE ANON KEY HERE'
);
supabase
.from('*')
.on('*', (payload) => {
console.log('payload', payload);
})
.subscribe();
I’ve tried for all tables (from('*')
) as well as individual tables (from('messages')
).
I’ve tried for all events (on('*')
) as well as specific events (on('INSERT')
)
Expected behavior
The realtime subscription should work as expected, whenever INSERT
, UPDATE
or DELETE
events happen in any table, it should run the callback and log the output to screen.
Screenshots
System information
- OS: Windows Subsystem for Linux (Ubuntu) on Windows 10
- Browser: Firefox, Chrome, Brave
- Version of supabase-js:
1.30.3
- Version of Node.js:
16.13.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Thank you soooooooo much, @w3b6x9
I created a new project and the problem solved!
I was just soo frustated because it was not working.
Thanks once again!
@infolinematrix @Zeglius can you please submit support tickets here: https://app.supabase.com/support/new