© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•6mo ago•
9 replies
Mikey

Supabase broadcast not working in local development

I am using sveltekit and supabase ssr i have a code snippet that proves it is not working.

onMount(() => {
  if (!page.data.supabase) return;

  const broadcastChannel = page.data.supabase
    .channel('TEST')
    .on('broadcast', { event: 'typing' }, (payload) => {
      //this doesnt log anything from my sendTyping function
      console.log(payload);
    })
    .subscribe();

  return () => broadcastChannel.unsubscribe();
});

const sendTyping = () => {
  if (!page.data.supabase) return;

  const sendingTyping = page.data.supabase.channel('TEST');

  sendingTyping
  .send({ type: 'broadcast', event: 'typing', payload: { from: page.data.user?.id } })
  .then((x) => {
    //this tells me that it sent successfully it logs 'typing sent ok'
    console.log('typing sent', x);
  });
};
onMount(() => {
  if (!page.data.supabase) return;

  const broadcastChannel = page.data.supabase
    .channel('TEST')
    .on('broadcast', { event: 'typing' }, (payload) => {
      //this doesnt log anything from my sendTyping function
      console.log(payload);
    })
    .subscribe();

  return () => broadcastChannel.unsubscribe();
});

const sendTyping = () => {
  if (!page.data.supabase) return;

  const sendingTyping = page.data.supabase.channel('TEST');

  sendingTyping
  .send({ type: 'broadcast', event: 'typing', payload: { from: page.data.user?.id } })
  .then((x) => {
    //this tells me that it sent successfully it logs 'typing sent ok'
    console.log('typing sent', x);
  });
};
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

Supbase local development not working
SupabaseSSupabase / help-and-questions
4y ago
Supabase Storage In Local Development Not Returning Images
SupabaseSSupabase / help-and-questions
4y ago
Managing envs in local supabase development
SupabaseSSupabase / help-and-questions
4mo ago
Supabase Realtime Broadcast Not Working from C# Backend
SupabaseSSupabase / help-and-questions
4mo ago