© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•8mo ago•
1 reply
David Huson

Realtime Presence Docs conflict with type system

Hi, I'm trying to implement presence in my Nextjs application. I've been following the documentation as well as the guides on how to do this, but the docs seem to offer incorrect examples. Per the docs, I've set up the channel and subscription like so:
const channel = supabase.channel(`presence-${roomId}`, {
  config: {
      presence: {
          key: user.id,
      },
  },
});

channel
.on('presence', { event: 'sync' }, () => {
  const newState = channel.presenceState()
  console.log('sync', newState)
})
.subscribe(async (status) => {
  if (status === 'SUBSCRIBED') {
      const presenceTrackStatus = await channel.track({ 'user_id': 1 })
      console.log(presenceTrackStatus, 'presenceTrackStatus')
  }
})

return () => {
  channel.unsubscribe();
}
const channel = supabase.channel(`presence-${roomId}`, {
  config: {
      presence: {
          key: user.id,
      },
  },
});

channel
.on('presence', { event: 'sync' }, () => {
  const newState = channel.presenceState()
  console.log('sync', newState)
})
.subscribe(async (status) => {
  if (status === 'SUBSCRIBED') {
      const presenceTrackStatus = await channel.track({ 'user_id': 1 })
      console.log(presenceTrackStatus, 'presenceTrackStatus')
  }
})

return () => {
  channel.unsubscribe();
}


However, when i do this, i get an error in the subscribe callback that says:
Promise returned in function argument where a void return was expected.
Promise returned in function argument where a void return was expected.


Can i just ignore this, since it's coming from eslint? Or am i doing something wrong?
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 presence
SupabaseSSupabase / help-and-questions
4y ago
Realtime Presence reconnection handling
SupabaseSSupabase / help-and-questions
4mo ago
Best way to have live viewer count with realtime presence
SupabaseSSupabase / help-and-questions
4w ago
Presence
SupabaseSSupabase / help-and-questions
4y ago