Lovable
database
Realtime Subscriptions Not Receiving Updates
Realtime subscriptions are set up but changes made by other users or external updates are not reflected in the UI. The app shows stale data even though data changed in the database.
Realtime requires explicit table replication configuration. Many tables have realtime disabled by default. Subscriptions also need to be set up before the page loads.
Error Messages You Might See
Realtime is not enabled for this table
WebSocket connection failed
Permission denied for realtime
Common Causes
- Table doesn't have realtime replication enabled in Supabase dashboard
- Subscription set up after initial data load
- Using .select() query that doesn't match subscription filter
- Supabase JWT missing realtime permissions
- WebSocket connection blocked by CORS or firewall
How to Fix It
Enable realtime in Supabase dashboard > Table Editor > click table > Replication section.
Subscribe before loading data:
useEffect(() => {
const subscription = supabase
.from('messages')
.on('*', (payload) => {
setMessages(prev => [...prev, payload.new]);
})
.subscribe();
return () => subscription.unsubscribe();
}, []);Real developers can help you.
You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.
Get Help