© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
1 reply
beroer

realtime subscription error - TS

i'm trying out realtime subscription for the first time and got into an error i don't know much about:

  useEffect(() => {
    const channel = supabase.channel('realtime draft')
      .on(
        'postgres_changes',
        { event: '*', schema: 'public', table: 'draft' },
        (payload: ProductItemType[]) => {
          console.log('Change received!', payload)
          router.refresh()
        }).subscribe()

    return () => {
      supabase.removeChannel(channel)
    }
  }, [])
  useEffect(() => {
    const channel = supabase.channel('realtime draft')
      .on(
        'postgres_changes',
        { event: '*', schema: 'public', table: 'draft' },
        (payload: ProductItemType[]) => {
          console.log('Change received!', payload)
          router.refresh()
        }).subscribe()

    return () => {
      supabase.removeChannel(channel)
    }
  }, [])


postgres_changes
postgres_changes
is underlined with the following:
Diagnostics:
1. No overload matches this call.
     The last overload gave the following error.
       Argument of type '"postgres_changes"' is not assignable to parameter of type '"broadcast"'. [2769]
Diagnostics:
1. No overload matches this call.
     The last overload gave the following error.
       Argument of type '"postgres_changes"' is not assignable to parameter of type '"broadcast"'. [2769]


i'm using typescript.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

realtime subscription reliability
SupabaseSSupabase / help-and-questions
7mo ago
Realtime subscription stopped working
SupabaseSSupabase / help-and-questions
4y ago
Realtime subscription return missing value
SupabaseSSupabase / help-and-questions
4y ago
join crashed realtime database subscription
SupabaseSSupabase / help-and-questions
5mo ago