Skip to content

CHANNEL_ERROR error: mismatch between server and client bindings for postgres changes #1917

@biscoe916

Description

@biscoe916

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 listed

I'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 notifications table was created via migration and added to supabase_realtime publication 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.1

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsupabase-jsRelated to the supabase-js library.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions