question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supabase realtime not working!

See original GitHub issue

Bug 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

image

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:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
thesyedbasimcommented, Feb 21, 2022

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!

0reactions
w3b6x9commented, Sep 20, 2022

@infolinematrix @Zeglius can you please submit support tickets here: https://app.supabase.com/support/new

Read more comments on GitHub >

github_iconTop Results From Across the Web

Supabase realtime not working! · Issue #5554 - GitHub
Bug report Describe the bug The realtime feature of supabase is not working. I am able to insert, delete etc. But just the...
Read more >
Why is realtime not working for me? : r/Supabase - Reddit
I have a project using sveltekit with prisma, so the tables are created by the prisma migration tool (not sure if this causes...
Read more >
Realtime | Supabase
Supabase provides a globally distributed cluster of Realtime servers that enable the following functionality: Broadcast: Send ephemeral messages from client ...
Read more >
I can't get Supabase real-time listen to Postgres changes to work
I'm assuming your listener isn't triggered because one of those: filter is too specific and your changes don't trigger it: e.g. are you...
Read more >
Let's Play With Realtime (Using Supabase), pt. 2
No, blender is not still running. Also, how fun was that episode? Did you all have fun with prints? Any chance I get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found