Cannot run function locally, possibly due to deno version or std version.
Before I get into this, I just want to say that I've found edge functions and deno generally to be very difficult to use. There has not been much documentation to cover common failure modes and much of the libraries (even the standard library itself!) is considered unstable per the deno site. The user experience has not aligned with the rest of supabase in my opinion.
On to the main topic: I created a couple of edge functions about a month ago and got them working. Yesterday I decided I wanted to update on of them. So as I typically do, I updated my supabase cli, my deno runtime, and restarted all my local containers. Everything should be up to date now. I went to run the functions locally and sure enough, they are broken.
You can find the output here: https://gist.github.com/point-source/a1831e9b109878df6c11aac718e62dd1
To improve search on here, the first line of output is:
Googling this issue doesn't turn up much other than pointing to possible a version mismatch somewhere amongst the dependencies. I noticed that the error is looking at deno standard library 0.153.0 while the latest is 0.158.0. Since my local runtime is up-to-date, I can only assume that this is either coming from my function (which does not specify a std lib version) or from supabase docker stack or cli.
How do I figure out what std library version is being used by supabase when I deploy a function locally? Where exactly is this function being run? How to I keep the supabase deno runtime and my local machine deno version in sync so that I can get correct analysis in vscode while I write these functions?
How do I manage dependencies with deno? It seems like it wants me to do that by putting version numbers in the import urls but this would require me to upgrade them by searching for each one and updating the version by hand. This sounds awful. Why isn't there a package.lock or similar?
I'm just so frustrated with supabase edge functions generally and it's such an unusual stack that it's hard to find help. For context, I've used azure and gcp functions for years now.
On to the main topic: I created a couple of edge functions about a month ago and got them working. Yesterday I decided I wanted to update on of them. So as I typically do, I updated my supabase cli, my deno runtime, and restarted all my local containers. Everything should be up to date now. I went to run the functions locally and sure enough, they are broken.
You can find the output here: https://gist.github.com/point-source/a1831e9b109878df6c11aac718e62dd1
To improve search on here, the first line of output is:
Argument of type '"CAA"' is not assignable to parameter of type 'RecordType'Googling this issue doesn't turn up much other than pointing to possible a version mismatch somewhere amongst the dependencies. I noticed that the error is looking at deno standard library 0.153.0 while the latest is 0.158.0. Since my local runtime is up-to-date, I can only assume that this is either coming from my function (which does not specify a std lib version) or from supabase docker stack or cli.
How do I figure out what std library version is being used by supabase when I deploy a function locally? Where exactly is this function being run? How to I keep the supabase deno runtime and my local machine deno version in sync so that I can get correct analysis in vscode while I write these functions?
How do I manage dependencies with deno? It seems like it wants me to do that by putting version numbers in the import urls but this would require me to upgrade them by searching for each one and updating the version by hand. This sounds awful. Why isn't there a package.lock or similar?
I'm just so frustrated with supabase edge functions generally and it's such an unusual stack that it's hard to find help. For context, I've used azure and gcp functions for years now.
