I was working on React.js with Supabase SDK. It was working fine, but I realized that it was not working sometimes. Actually it didn't many any requests when I checked Network tab on browser.
console.log("hello");
const { data, error } = await supabase
.from("stages")
.select("id, prize_pool, ended_at, created_at")
.eq("is_active", true)
.limit(1)
.single();
console.log("hi");
In above code, I could see hello was printed on console, but hi wasn't printed. And there was no error and no requests. I am not sure what's the problem.
FYI, it was working again when I clear the browser cache.
Please share your full code when you are asking for help with an issue. The supabase docs state that you should not be adding await
's inside of the onAuthStateChange
as this can cause a dead-lock in the function. https://supabase.com/docs/reference/javascript/auth-onauthstatechange