cli icon indicating copy to clipboard operation
cli copied to clipboard

Supabase CLI as NPM dev-dependency not working the same as run by npx?!

Open Fefke opened this issue 1 year ago • 1 comments

Describe the bug I tried to fetch the Typescript-scheme of my PostgresDB from a different scheme than "public" and for some reason while running npm run supabase gen types typescript --project-id xyz -s "MyCustomSchemeAsNamedInPostgres" I am only allowed to receive the default scheme and only by running it via npx: npx supabase gen types typescript --project-id xyz -s "MyCustomSchemeAsNamedInPostgres", I receive the correct types for my specific scheme.

I dont know how the same tools can produce a different outcome on this. Possibly this is a bug of npm itself.

To Reproduce Pretty much both commands from above.

Both CLI-Versions being the same on v1.164.1.

Expected behavior I expect my custom scheme to be generated as typescript-types in both cases.

Screenshots At first by running it with npm run I have to select the project-id anyway - although it's already declared: image

The actual type-Generation looks like this: image not being/containing the requested scheme.

If I run the same supabase-cli command via npx, it works as I intended it to: image

It's notable, that every other supabase-cli-command I used so far is working as intended, only the type-generation has this weird behaviour.

Thank you for your time and this great project!

System information

  • Version of OS: Ubuntu 22.04 LTS (WSL2)
  • Version of CLI: 1.164.1
  • Version of Docker: Docker version 25.0.3, build 4debf41

Additional context

Fefke avatar Apr 30 '24 14:04 Fefke

As a sanity check, could you run both npm run supabase --version and npx supabase --version to check that they match?

sweatybridge avatar May 01 '24 13:05 sweatybridge

closing as stale. probably due to version mismatch as postgres-meta only started supporting non-public schemas recently.

sweatybridge avatar Jun 10 '24 14:06 sweatybridge