-
Notifications
You must be signed in to change notification settings - Fork 538
Labels
bugSomething isn't workingSomething isn't workingsupabase-jsRelated to the supabase-js library.Related to the supabase-js library.
Description
Describe the bug
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
I'm using @supabase/supabase-js to subscribe to postgres_changes on a notifications table. The subscription consistently fails with:
CHANNEL_ERROR error: mismatch between server and client bindings for postgres changes
My setup:
const channel = this.sb
.channel(`notifications:${uid}`)
.on(
'postgres_changes',
{
event: '*',
schema: 'public',
table: 'notifications',
},
(payload) => {
console.log('Realtime event:', payload);
}
)
.subscribe((status, err) => {
console.log('Subscription status:', status, err?.message);
});The table is properly added to the supabase_realtime publication:
ALTER PUBLICATION supabase_realtime ADD TABLE notifications;I've verified the table is in the publication:
SELECT * FROM pg_publication_tables WHERE pubname = 'supabase_realtime';
-- notifications is listedI've also tried:
- Dropping and re-adding the table to the publication
- Toggling Realtime on/off in the dashboard
- The table has RLS enabled with proper policies
- Other tables (goals, tasks, comments) work fine with the same pattern
Expected behavior
The subscription should return SUBSCRIBED status and receive postgres_changes events.
System information
- OS: macOS
- Browser: Chrome
- Version of supabase-js: (check your package.json)
- Version of Node.js: (run
node -v)
Additional context
- Using hosted Supabase (not local)
- The
notificationstable was created via migration and added tosupabase_realtimepublication in the same migration - Other tables created in similar migrations work correctly with Realtime
- The subscription briefly shows "Subscribed to PostgreSQL" in websocket messages, then immediately closes
Library affected
supabase-js
Reproduction
No response
Steps to reproduce
No response
System Info
System:
OS: macOS 15.5
CPU: (14) arm64 Apple M4 Pro
Memory: 985.91 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.18.0 - /Users/user1/.nvm/versions/node/v22.18.0/bin/node
npm: 10.9.3 - /Users/user1/.nvm/versions/node/v22.18.0/bin/npm
pnpm: 10.12.3 - /opt/homebrew/bin/pnpm
bun: 1.2.22 - /Users/user1/.bun/bin/bun
Browsers:
Chrome: 142.0.7444.176
Safari: 18.5
npmPackages:
@supabase/supabase-js: ^2.45.4 => 2.76.1Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Supabase JS Library issue and not an issue with the Supabase platform. If it's a Supabase platform related bug, it should likely be reported to supabase/supabase instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingsupabase-jsRelated to the supabase-js library.Related to the supabase-js library.