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)
    }
  }, [])


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]


i'm using typescript.
Was this page helpful?