Skip to content

Title: Realtime updates not received on first page load when using createBrowserClient from @supabase/ssr in Next.js #122

@Ghoral24

Description

@Ghoral24

I’m experiencing an issue where realtime updates are not received on the first page load when using createBrowserClient (e.g. from @supabase/ssr or @supabase/auth-helpers-nextjs) in Next.js.

The connection appears to be established (channel subscribes without error), but no events are delivered until I navigate away and return (for example, visiting a detail page and then going back).

Reproduction Steps

  1. Use createBrowserClient in a global provider or page component.
  2. Subscribe to postgres_changes for a table via:
    supabase .channel('my-channel') .on( 'postgres_changes', { event: '*', schema: 'public', table: 'my_table' }, (payload) => console.log(payload) ) .subscribe();
  3. Load the page — no realtime updates are received when the database changes.
  4. Navigate to another page (e.g. /detail/[id]) and then return to the original page.
  5. Updates begin to arrive as expected.

Expected Behavior
Realtime updates should start arriving immediately upon subscription on the first page load

Environment

  1. @supabase/ssr: ^0.6.1
  2. @supabase/supabase-js: ^2.54.0
  3. next: ^15.3.2
  4. Client creation method: createBrowserClient from @supabase/ssr
  5. Setup: Supabase Realtime is enabled on the table in the dashboard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions