Open evelant opened 1 year ago
This appears to be an issue with eszip https://github.com/denoland/eszip/issues/121
Another problem here is that when the bundling process fails it does not give any useful debug output. I think this is due to the code here https://github.com/supabase/cli/blob/main/internal/utils/denos/build.ts where it just throws a useless error such as "file not found" without logging what file it was trying to read.
I also can't find https://github.com/supabase/cli/blob/main/internal/utils/denos/build.ts anywhere in my node_modules, is it compiled directly into the supabase binary? I wanted to patch it to get more useful output but am unable to find it.
@evelant Will take a look at this issue next week.
I also can't find https://github.com/supabase/cli/blob/main/internal/utils/denos/build.ts anywhere in my node_modules, is it compiled directly into the supabase binary? I wanted to patch it to get more useful output but am unable to find it.
You can clone the Supabase CLI repo and run it with a patched version of the file locally. Instructions on how to run it locally should be available in the repo.
Just a note for the fix
functions deploy
, you need to run it like: DENO_AUTH_TOKENS=... supabase functions deploy foo
functions serve
, you need to set DENO_AUTH_TOKENS
inside your --env-file
Let us know if that works!
@soedirgo @laktek it works now, thank you!
Bug report
Describe the bug
Loading dependencies from a private source fails when bundling edge functions. I've got an auth token for the private code in env.DENO_AUTH_TOKENS (per deno docs) and Deno can download and cache the code without issue. The function runs fine locally but bunding fails as soon as I attempt to deploy.
To Reproduce
deno cache -r index.ts
caches the files without problem. Also observe thatsupabase functions serve my-function
works without issue.supabase functions deploy my-function
and observe the crash during bundling when it cannot access the files in the private repositoryExpected behavior
Anything that works locally should successfully bundle and deploy.
Screenshots
N/A
System information
Additional context
This is blocking me from progressing in my migration from firebase to supabase. Everything works locally but I can't deploy due to this bug.