cli icon indicating copy to clipboard operation
cli copied to clipboard

Document default supabase/functions/.env for supabase start

Open evelant opened this issue 2 years ago • 2 comments

Bug report

  • [X ] I confirm this is a bug with Supabase, not with my own application.
  • [ X] I confirm I have searched the Docs, GitHub Discussions, and Discord.

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

  • OS: macOS
  • Browser (if applies) N/A
  • Version of supabase: 1.49.4
  • Version of Node.js: 16.19.0

Additional context

evelant avatar Apr 06 '23 17:04 evelant

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

Is that sufficient for your use case?

sweatybridge avatar Apr 07 '23 01:04 sweatybridge

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

evelant avatar Apr 07 '23 20:04 evelant