I'm trying to use Supabase with deno.
I used import { createClient } from "https://esm.sh/@supabase/supabase-js"
but it only gives me errors like
Module '"deno:///missing_dependency.d.ts"' uses 'export =' and cannot be used with 'export *'
Asked
Active
Viewed 2,493 times
5

Programmer Developement
- 145
- 2
- 12
-
try to import from this url for [deno supabase](https://deno.land/x/supabase@1.1.0): https://deno.land/x/supabase/mod.ts – about14sheep Feb 19 '22 at 17:22
-
2Already saw that, but it throws an error too; I think it's outdatet not only because it's about 150 Commits behind supabase. Error: error: Uncaught TypeError: Cannot read properties of undefined (reading 'href') if (!url) url = window.location.href – Programmer Developement Feb 19 '22 at 17:26
2 Answers
3
Solved: Used import { createClient } from "https://cdn.jsdelivr.net/npm/@supabase/supabase-js/+esm"

Programmer Developement
- 145
- 2
- 12
-
2It fixes the error, but in you lose the type definitions with this file – Maximilian Lindsey Apr 04 '22 at 21:54
2
Using the Supabase Deno package works for me.
import { supabaseClient } from "https://deno.land/x/supabase_deno/mod.ts";
const sbclient = new supabaseClient("https://xyz.supabase.co","your-anon-key")
const sbTableItems = new supabaseTableItems(sbclient, "your-table");
const result = await sbTableItems.add(data);

Maximilian Lindsey
- 809
- 4
- 18
- 35
-
3Thanks, but that's literally my own code, I tried to do it on my own – Programmer Developement May 13 '22 at 15:43