Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Supabase Generate Types Failing

I am trying to run the command to update my typing via cli and it continues to give me the following error but when I debug this is all I get. Not much to work with.

2023/03/01 09:34:01 Recv First Byte
Error: failed to retrieve generated types: {"message":"Forbidden resource"}

I am running the following command

 npx supabase gen types typescript --project-id "$MY_ID" --schema public > types/supabase.ts --debug

If someone has seen this issue before please let me know. I have been using this command previously with no issues prior and now it seems to be causing issues.

like image 804
Luke Longo Avatar asked Jul 10 '26 22:07

Luke Longo


2 Answers

For someone struggeling with this error message:

Error: failed to retrieve generated types: {"message":"Forbidden resource"}

make sure in your command you set --project-id to the Reference ID of the project and not your project name.
You can find your Reference ID in Project -> Settings -> General.
A Reference ID should look something like this: lxlsblablagbblacblanzb

like image 94
Ivailo Korakov Avatar answered Jul 14 '26 08:07

Ivailo Korakov


The issue was from being logged into a different supabase account via the supabase access token. Make sure to have logged into the correct supabase account via the supabase cli and using your correct access token.

like image 31
Luke Longo Avatar answered Jul 14 '26 09:07

Luke Longo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!