supabase: Real time not working in Local Dev
Bug report
- I confirm this is a bug with Supabase, not my application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Real-Time is NOT working on local-dev env but works fine on the supabase instance using the same code
also tried re-installing local docker image as well
Enabled in the config.toml
file
also have real-time enabled in local dev using the studio
Code snippet :
const supabase = createClient<Database>(
supabaseUrl,
supabaseAnonKey,
{
auth: {
storage: AsyncStorage,
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false,
},
}
);
useEffect(() => {
const subscription = supabase
.channel('custom-all-channel')
.on('postgres_changes', { event: '*', schema: 'public', table: 'user_orders' }, payload => {
refetch();
console.warn(payload);
})
.subscribe();
return () => {
refetch();
supabase.removeChannel(subscription);
};
}, []);
To Reproduce
- spin up a local supabase instance
- link your local instance to your supabase instance and sync the data
- enable real-time in your local supabase project
- try using it on your client projects to your local supabase instance to see real-time not working
Expected behaviour
Real-time functionality should work as it works on the supabase instance
System information
- OS: [Ubuntu]
- Version of supabase-js: [2.38.0]
- Version of Node.js: [v18.19.1]
About this issue
- Original URL
- State: open
- Created 4 months ago
- Comments: 17 (16 by maintainers)
Hi @Mohammed-Yasin-Mulla ,
Sorry, I should have mentioned that I had tried this successfully locally.
For the logs, these are not enabled by default, if you edit the
supabase/config
file then you can changeenabled
totrue
under theanalytics
heading, here: