Uncaught TypeError supabase.auth.user is not a function
I'm trying to figure out what I've done wrong here, and have been unsuccessful thus far. The error i'm getting is "Uncaught TypeError supabase.auth.user is not a function". The issue is at line 18 in my App.vue file (I'm using Vue 3). On that line is (as shown in code pictured). I'm not sure what I'm missing or did wrong.
11 Replies
You likely are using supabase-js v2. .user is no longer the name of the function.
@garyaustin Okay. I'm just going off what current docs say
See under "User" section
Supabase JavaScript Library
Supabase JavaScript Library
Looks like they missed that line in the API section of the UI. I notice the other ones (the varius sign ins) are v2. Probably needs to be flagged as an issue in supabase/supabase github.
I will do so. Appreciate the help! Switching .user to .getUser resolved it
@garyaustin Well, I have that part, however, once I log out, I get this error, and I have no clue what to do to resolve this.

This is the error it is giving me at that URL: {"message":"No API key found in request","hint":"No
apikey
request header or url param was found."}You will probably want to ask a new question. Normally you use getSession in v2 and the user object from that for detecting a signin in progress. When you logout getUser will fail I assume since you no long have a session.
Okay.