Error: mismatch between server and client bindings for postgres changes
I am trying to automatically sync database state to state in frontend app.
const setupRealtimeSubscription = async () => {
const channel = supabase
.channel("videos-changes")
.on(
"postgres_changes",
{
event: "*",
schema: "public",
table: "videos",
filter:
user_id=eq.${user.id},
},
(payload) => {
console.log("Realtime event received:", payload);
}
)
.subscribe((status, err) => {
});
As I refresh the page, sometimes it works properly, sometimes this error (on attached image) happens.
I have free subscription plan
2 Replies
I see that there is a similar issue here https://discord.com/channels/839993398554656828/1011739666774507532 which a user has fixed by upgrading to a newer version of
supabase-js. Perhpas worth checking if this could be an issue for you?Issue was that user.id wasn’t getting properly set, once that got fixed it worked properly.
Anyway, I switched to broadcasting as it is more suitable for scaling.