3

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.

Luke Longo
  • 119
  • 1
  • 7

3 Answers3

5

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

Ivailo Korakov
  • 357
  • 2
  • 14
3

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.

Luke Longo
  • 119
  • 1
  • 7
  • 1
    Same for me! I just run supabase login and insert the actual access token used for that project – Diego May 03 '23 at 15:56
1

Do this:

  1. Run "supabase login"
  2. Enter your access token
  3. Try to redo what you wanted from here...
Manbus
  • 706
  • 4
  • 9