supabase-js icon indicating copy to clipboard operation
supabase-js copied to clipboard

Deno support

Open Hexagon opened this issue 2 years ago • 7 comments

Chore

Describe the chore

  • Publish on deno.land/x
  • Docs on how to install on Deno

Additional context

It would be nice with "official support" for Deno!

Hexagon avatar Mar 30 '23 22:03 Hexagon

We don't "official support" Deno, and at the moment I don't think we plan to "official support" Deno. But you can install supabase-js using esm.sh. Here is the Supabase documentation on how to install supabase-js for Deno.

Isaiah-Hamilton avatar Apr 03 '23 13:04 Isaiah-Hamilton

@Isaiah-Hamilton

Maybe this should be opened as a separate issue, but I am encountering an error when using the @supabase/auth-helpers-shared package from esm.sh, but the issue comes from that package's own type imports from the @supabase/supabase-js package.

Error: Module not found "https://esm.sh/v113/@supabase/[email protected]/dist/module/lib/types/dist/module/index.d.ts".

I can import the supabase-js package directly using that URL up to the version number, and using the auth helper package is working great locally, but this error is thrown when trying to bundle and deploy my function. Is it possible the package is somehow incomplete in esm.sh (specifically the type declarations)?

Auth Helper Package - https://esm.sh/@supabase/[email protected]

EDIT:

For more context - I was able to get the deployment to work by using the auth helpers package from this CDN: https://cdn.jsdelivr.net/npm/@supabase/auth-helpers-shared/+esm

That CDN location doesn't provide any type information, though.

5hee75 avatar Apr 04 '23 03:04 5hee75

@5hee75 can you open a separate issue.

Isaiah-Hamilton avatar Apr 06 '23 18:04 Isaiah-Hamilton

@Isaiah-Hamilton

https://github.com/supabase/supabase-js/issues/744

5hee75 avatar Apr 07 '23 05:04 5hee75

@Isaiah-Hamilton Why not? If you make a couple of small adjustments to the codebase this library would work in Deno (and Node, and Bun) with correct types ootb (without esm.sh), Deno could even be pointed directly at the unprocessed source code.Would be great imho!

Hexagon avatar Apr 07 '23 14:04 Hexagon

@Hexagon what are some of those adjustments that need to be made to make it work? Might be worth putting a PR together, if it's not too crazy.

5hee75 avatar Apr 18 '23 14:04 5hee75

Havn't looked at the codebase, but I'd lay it out like: make a fork, try to include it locally with deno, and adjust til it works :) Either run Deno agains the actual source (if possible), or make an esm build of it.

Hexagon avatar Apr 18 '23 15:04 Hexagon

Resolved by supabase-js being available on jsr

Hexagon avatar Jul 17 '24 22:07 Hexagon