cli icon indicating copy to clipboard operation
cli copied to clipboard

During "supabase init" I can see failed to parse settings: invalid character '/' looking for beginning of object key string

Open Tananga opened this issue 2 years ago • 2 comments

  • OS: MacOs
  • Version of CLI 1.127.4

Screenshot 2024-01-08 at 23 24 40

Supabase was initialised successfully but I can see error message durning "supabase init". Im just putting it here because I was not able to find anything like that in previous issues.

Tananga avatar Jan 08 '24 22:01 Tananga

Could you check your vscode settings file? The invalid character may be from there. The path is supabase/.vscode/settings.json

My best guess is you have // comments in settings.json which causes the parser to throw an error.

sweatybridge avatar Jan 09 '24 02:01 sweatybridge

@sweatybridge I am experiencing below error when bunx supabase init while it is fine with npx supabase init.

failed to parse settings: invalid character ']' looking for beginning of value

hyochan avatar Jun 07 '24 02:06 hyochan

I had this same issue. I fixed it by removing the comments in supabase/functions/hello-world/deno.jsonc (I was using the getting started guide).

It now looks like this:

{
  "imports": {
  }
}

It previously looked like this:

{
  "imports": {
     // Some comments
     // But ultimately no imports
  }
}

Seems to be an issue with parsing comments in .jsonc files.

Tested on Linux with Supabase CLI 2.3.1 and 2.4.1.

notalexfer avatar Jan 08 '25 18:01 notalexfer