-
-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deno / Deno Deploy compatibility #161
Comments
Nice one, thanks @jcs224. Did you attempt this one already? Where there any issues/errors? |
@kiwicopple I didn't try it with Deno Deploy yet, just the regular Deno CLI. I will try it with Deno Deploy, I'm sure the issues will be similar. Deno Deploy only has a subset of the Deno CLI since it's meant to run in an idempotent serverless environment (at least that's my understanding). The first show-stopper has to to with Once I tried a workaround to ignore the XMLHttpRequest keyword, I got an error from GoTrue saying that |
As I look into it more, I might try just using the |
Agreed 👍 . This will still be compatible with Supabase projects too (you can just append |
So, just tried this with |
If you manage to solve it in cross-fetch, you'd also solve the problem for Cloudflare workers and Vite, so that would be a huge contribution |
A little bit of a shot in the dark (hard to test with Deno as Skypack and jspm aren't cooperating with my test packages), but I sent a PR to |
Hello =) Any news on PR? I'd really like to use supabase-js client in deno environment, but because of lack of XMLHttpRequest, it is not possible =( |
@abnemo this is an upstream dependency that will likely need to be updated. You should add a comment or give an emoji on this issue, maybe it will help get the ball rolling: JakeChampion/fetch#956 |
I would love to see a dedicated supabase package on Deno land. |
Tried to run |
Well, someone ported all the Supabase JS libraries to Deno!
I tried just running Skypack, esm.sh, and jspm versions of Supabase, still not working. But, maybe stuff from these ports can be merged in with Supabase proper somehow? @link-discord? |
@salemalem ☝️ |
yeah I was crazy enough to go ahead and port everything. |
What also helped porting is the fact they added websocket support to deno while I was porting the realtime lib |
Also none of the ports use external dependencies only native things built in deno just so you know |
The following works with esm.sh: import "https://deno.land/x/xhr@0.1.2/mod.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js";
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key');
console.log(supabase.supabaseUrl); // https://xyzcompany.subabase.co |
While the Deno runtime does support Deno Deploy doesn't support That means the Deno port of supabase-js (https://deno.land/x/supabase@1.2.0/) doesn't work on Deno Deploy. Anyone tried the Deno port of PostgREST (https://deno.land/x/postgrest) with Deno Deploy specifically? |
@andrew-pyle |
@salemalem My observations above are specifically about the Deno Deploy service. The Deno port of supabase-js works fine with Deno on the command line. |
Oh so it will work perfectly if I will host it on Digital Ocean, right? |
Give it a try and let us know what happens. It should work as far as I can tell. |
I haven't updated the ports in a while but I will probably update them soon again |
I just updated all the deno ports to match the current code of the supabase js libs |
The official recommendation is to use supabase-js via esm.sh (it wasn't working at the time this issue was created, but should work now). The situation with LocalStorage on Deno is unfortunate (there's a similar issue on Node) - you might need to use the service_role key which bypasses RLS (make sure to harden your Function!) instead of signing in with Auth. |
esm.sh v112 will inject |
Feature request
Is your feature request related to a problem? Please describe.
I tried importing a Skypack and jspm version of the supabase-js client library, without success. I can create issues for the problems if you want, but since no one has brought up Deno yet I thought I'd start with a feature request.
Also, it would be really cool to be able to use Supabase with the new Deno Deploy service, just announced a couple of weeks ago.
https://deno.com/deploy
Describe the solution you'd like
Compatibility and instructions on how to use Deno / Deno Deploy with Supabase.
Describe alternatives you've considered
Using Node, of course :p but Deno is really nice to use and seems ambitious and forward thinking, similar to Supabase.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: