Open groksrc opened 8 months ago
What version of std are you using in your edge function?
There are several versions of it that get imported here. std@0.214.0
is the version imported by postgres@v0.17.2
that causes the problem.
std@0.168.0
is imported directly in the test file, that's from the supabase new
boilerplate but doesn't have any bearing on this afaict.
std@0.182.0
also gets imported as a dependency from somewhere else.
These are shown in the server
console output above.
@iuioiua Is this imported correctly in the Deno std library?
https://deno.land/std@0.214.0/crypto/crypto.ts?source#L112
It is exported in the wasm.mod
file, but this is a type. I don't know if the type identifier is required...
I checked all three versions of std, and all have DigestAlgorithm
exported as types in the wasm.mod
file.
Describe the bug
This change introduces an import error with respect to the crypto library when conntecting to secured instances with TLS: https://github.com/denodrivers/postgres/commit/51e34b26cb39ca287dbab87f8e018e757658a4f5
When attempting to instantiate a new instance of the postgres client a worker boot error is thrown:
To Reproduce
Steps to reproduce the behavior:
With a new supabase project:
$ supabase functions new test
Modify the file test/index.ts
const databaseUrl = Deno.env.get('SUPABASE_DB_URL')
serve(async (req) => { const client = new postgres.Client(databaseUrl); client.connect(); const data = { message:
Booted!
, }return new Response( JSON.stringify(data), { headers: { "Content-Type": "application/json" } }, ) })
Client
Additional context
If applicable, add any other context about the problem here.