© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
65 replies
pida

How to debug "CHANNEL_ERROR" when using supabase-realtime?

Hi,

I'm trying to build an app that needs bidirectionnal connection so I'm using realtime to push data to the app. Basically I have an Electron desktop app that serves as a middleware to a local database and i need to push data to that database. And I need the channel to stay up as long as possible.

When I check the subscription logs, I get this behaviour (picture 1):
channel_error > subscribed > channel_error > subscribed ...

Looking at the source code, I see that
subscribe
subscribe
method takes a callback as argument and that callback is given
status
status
and
error
error
as argument.
So I tried debugging using this small snippet of code:
export const createRealtime = (schemaName: string) => {
  supabase.channel("XXX").on("postgres_changes", { event: "INSERT", schema: schemaName, table: "XXX" }, payload => { console.log(payload) }).subscribe(handleReconnect)
}

const handleReconnect = (event: string, error: Error) => {
  console.log(Date.now(), event, error)
}
export const createRealtime = (schemaName: string) => {
  supabase.channel("XXX").on("postgres_changes", { event: "INSERT", schema: schemaName, table: "XXX" }, payload => { console.log(payload) }).subscribe(handleReconnect)
}

const handleReconnect = (event: string, error: Error) => {
  console.log(Date.now(), event, error)
}

As you can see on the screenshot there is no error.

Is there a way to debug this?

Is this normal behaviour to get disconnection if there is no data?

Thanks a lot
image.png
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
Next page

Similar Threads

CHANNEL_ERROR: Issues Subscribing to Realtime Changes with Supabase
SupabaseSSupabase / help-and-questions
13mo ago
how to manually close realtime channel?
SupabaseSSupabase / help-and-questions
4y ago
How do I debug subscription CHANNEL_ERROR?
SupabaseSSupabase / help-and-questions
4y ago
Error RealtimeChannels - occurred when joining realtime table=eq id
SupabaseSSupabase / help-and-questions
4y ago