Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Fefke opened this issue Apr 30, 2024 · 1 comment
Open

Comments

@Fefke
Copy link

Fefke commented Apr 30, 2024

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

@sweatybridge
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants