Hi everyone, I'm trying to get past "No API Key", ...
# help
e
Hi everyone, I'm trying to get past "No API Key", while I have the API key loaded in my .env. Any recommendations would help, ty.
n
Hello @emjay! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
b
@emjay Try console logging process.env
n
dR7900gs (2022-04-17)
b
You're not in Nextjs, using Vite or something like that?
e
@barry that's good to check. It's there. I'm able to establish a session, read users, though this happens with the first time I'm attempting to insert.
Thanks for the recommendation. I'm using React.
b
Might there be something like a supabase.isReady or something like that
e
What do you mean?
b
🤷‍♂️
Send code for the insert
e
I'm using the basic sample for insert from the API docs.
b
Do you check for error
e
Only seeing the console error. Do you mean within the function?
b
In the function
If error throw new error
e
I think that's helping, thank you (I'm new to async / await ). I'll resolve the below screenshot, I assumed it would insert a row using the current authenticated user. Though it's strange it's not showing the kong API error anymore, do you know why?
b
You didn't catch the error so it probably just screamed something at you.
e
Using this, I'm getting more specific errors, it looks like the API key is working and it's making an attempt. Ty again for the direction.
b
Wasn't exactly what I meant 😄
Copy code
js
const { data, error } = await supabase...

if (error) throw new Error(error)
e
I'll obviously google and read. Though I have to ask, do they not do the same thing? Googled, and reading.
I see!
@barry it worked, and I was able to insert a row by resolving the foreign key issue. I'll do some try/catch reading to get a better sense of when / why to use that. Thanks again.
n
Thread was archived by @emjay. Anyone can send a message to unarchive it.