supabase / cli

Supabase CLI. Manage postgres migrations, run Supabase locally, deploy edge functions. Postgres backups. Generating types from your database schema.
https://supabase.com/docs/reference/cli/about
MIT License
1.02k stars 201 forks source link

Document default supabase/functions/.env for supabase start #1001

Open evelant opened 1 year ago

evelant commented 1 year ago

Bug report

Describe the bug

I need to use a custom env file when running my functions locally due to the need for DENO_AUTH_TOKENS to load code from a private github repo (to work around the inability to reference local code outside of the functions dir).

This works fine with supabase functions serve --env-file supabase/.env.local.

Now that the cli automatically starts the edge runtime it is not possible to specify the env file which results in my local edge functions failing.

supabase start --env-file supabase/.env.local
Error: unknown flag: --env-file

To Reproduce

  1. supabase start --env-file your_path_to/.env
  2. Observe error

Expected behavior

There should be the option to load a .env file for edge functions when auto-started with supabase start

Screenshots

If applicable, add screenshots to help explain your problem.

System information

Additional context

sweatybridge commented 1 year ago

Hello, we added a default location for loading env file from, ie. supabase/functions/.env

Is that sufficient for your use case?

evelant commented 1 year ago

Yep that works fine! Perhaps the --help for supabase start should mention it however.