You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Guys,
wondering if anyone here has any issues with listening to Supabase realtime events on Vercel.
Everything works fine on localhost but as soon as it is deployed I'm not getting my updates anymore.
I've had the same problem with a SlackBot that I ended up hosting on render so I'm wondering if this is a know issue.
Are there settings on Vercel that I'm missing?
I'd like to keep using Vercel but everything seems to work out of the box on render.
Here's the code I use:
...
useEffect(()=>{if(!activeChat.id||!supabase)return;constsubscribedChannel=supabase.channel(`messages-thread-${activeChat.id}`).on('postgres_changes',{event: 'INSERT',schema: 'public',table: 'Message',filter: `chatId=eq.${activeChat.id}`,},(payload)=>{console.log('Change received!',payload);// here you can only add the payload if the chatId is the same as the active chatif(payload.new.chatId===activeChat.id)addMessage(payload.new);}).subscribe();console.log('subscribedChannel:',subscribedChannel);constunsubscribeFromMessages=()=>{supabase.removeChannel(subscribedChannel);};returnunsubscribeFromMessages;},[activeChat.id,supabase]);
...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hi Guys,
wondering if anyone here has any issues with listening to Supabase realtime events on Vercel.
Everything works fine on localhost but as soon as it is deployed I'm not getting my updates anymore.
I've had the same problem with a SlackBot that I ended up hosting on render so I'm wondering if this is a know issue.
Are there settings on Vercel that I'm missing?
I'd like to keep using Vercel but everything seems to work out of the box on render.
Here's the code I use:
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions