ngs
05/14/2022, 3:42 AMnull is not an object (evaluating 'ne.auth.user().id')
, even when implemented exactly as described in the quickstart. Any idea what I've done wrong? Or how to fix it?Needle
05/14/2022, 3:42 AMgaryaustin
05/14/2022, 4:36 AMNeedle
05/14/2022, 4:36 AMngs
05/14/2022, 12:48 PMasync function signOut() {
try {
loading = true
let { error } = await supabase.auth.signOut()
if (error) throw error
} catch (error) {
alert(error.message)
} finally {
loading = false
}
}
The component is nested in another a component which calls onAuthStateChange() like this:
supabase.auth.onAuthStateChange((_, session) => {
user.set(session.user);
});
When attempting to sign out, supabase throws the following alerts: null is not an object (evaluating 'i.user')
, then null is not an object (evaluating 'ne.auth.user().id')
I've stripped the signOut function down to just a raw const { error } = await supabase.auth.signOut()
, which itself throws the same error.
The whole thing is deployed on cloudflare pages, in case that might effect anything.