Hi all, I'm at a loss with trying to get realtime ...
# help
s
Hi all, I'm at a loss with trying to get realtime working. Replication is turned on for a table called
messages
but
const sub = supabase.from('messages').on("*", console.log).subscribe()
never prints anything. Is there something I'm missing? Thank you for any help!
n
Hello @sudoramen! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
🆕 realtime callback not firing
r
I was having the same problem.
Copy code
const regs = supabase
      .from('registrations')
      .on('*', payload => {
        console.log('Change received!', payload)
      })
      .subscribe((data: any) => {
        console.log(data);
      })
The above code gave me a Subcribed entry in the console.log but adding new records in the table doesn't log anything. After I disabled and re-enabled the event types it suddenly started working and events are logged in the console.
n
realtime callback not firing
s
So just toggling the Insert, Update, Delete, Truncate switches in Replication in the UI fixed it for you?
r
Pretty much
s
No good. I was testing it in a node program. I went ahead and tried in a svelte app and it worked just fine. Maybe the web socket being used only works in certain environments
2 Views