© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
9 replies
NuggetPirate

Property .on does not exist on supabase?

Trying to add a listener to realtime DB updates in a useEffect. Getting this error:

Property 'on' does not exist on type 'PostgrestQueryBuilder<any, any>'.ts(2339)
Property 'on' does not exist on type 'PostgrestQueryBuilder<any, any>'.ts(2339)


import { useSessionContext } from '@supabase/auth-helpers-react';

const Component() => {
const { session, supabaseClient } = useSessionContext();

useEffect(() => {
    const subs = supabaseClient
      .from("objects")
      .on("UPDATE", (payload) => {
        // dispatch(updateGameObject(payload.new.data));
      })
      .subscribe(console.log);
    subs.onClose(() => {
      console.log("on closed");
      supabase.removeAllSubscriptions();
    });
    return () => {
      subs.unsubscribe();
    };
  }
import { useSessionContext } from '@supabase/auth-helpers-react';

const Component() => {
const { session, supabaseClient } = useSessionContext();

useEffect(() => {
    const subs = supabaseClient
      .from("objects")
      .on("UPDATE", (payload) => {
        // dispatch(updateGameObject(payload.new.data));
      })
      .subscribe(console.log);
    subs.onClose(() => {
      console.log("on closed");
      supabase.removeAllSubscriptions();
    });
    return () => {
      subs.unsubscribe();
    };
  }
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

Property 'userStorage' does not exist on type 'SupabaseAuthClientOptions'
SupabaseSSupabase / help-and-questions
5mo ago
Property 'signIn' does not exist on type 'SupabaseAuthClient'.
SupabaseSSupabase / help-and-questions
4y ago
Property 'signIn' does not exist on type 'SupabaseAuthClient'.
SupabaseSSupabase / help-and-questions
4y ago
on().subscribe() - Property 'on' does not exist on type PostgrestQueryBuilder
SupabaseSSupabase / help-and-questions
4y ago