supabase-js
supabase-js copied to clipboard
[Deno] ESM.sh module not found - index.d.ts (types)
Bug report
Describe the bug
Attempting to import @supabase/supabase-js type definitions through esm.sh, when included as a secondary package, fails with the following error:
Error: Module not found "https://esm.sh/v113/@supabase/[email protected]/dist/module/lib/types/dist/module/index.d.ts".
To Reproduce
This specific issue was found when trying to include the @supabase/auth-helpers-shared package via https://esm.sh/@supabase/[email protected] in a Deno project (Edge Functions).
The following repo should be able to reproduce the error.
https://github.com/astor-tech/supabase-edge-trpc
Note: Functionality seems ok when serving locally. The only issue is the type imports, so just the supabase functions deploy fails.
Steps to reproduce
- Fork and clone the repo above
- Link to a Supabase project
- Run
supabase functions deploy - Note deployment error listed above
Expected behavior
Type definitions should be available for the @supabase/supabase-js SDK through the esm.sh module for Deno.
https://esm.sh/v113/@supabase/[email protected]/dist/module/lib/types/dist/module/index.d.ts
Additional context
I was able to get the deployment to work functionally by using the auth helpers package from this CDN:
https://cdn.jsdelivr.net/npm/@supabase/auth-helpers-shared/+esm
However, that CDN doesn't seem to provide any useful type info, so using it with tRPC (my use case) becomes somewhat limiting.
(Split from https://github.com/supabase/supabase-js/issues/739)
@5hee75 Did you manage to resolve this? I have exactly the same problem with:
import { serve } from "https://deno.land/[email protected]/http/server.ts"
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2?target=deno&no-check';
The edge function works just fine, but I am not able to build my next app because of this.
@nalnir @5hee75 you can add supabase to the exclude section of tsconfig.json
"exclude": ["node_modules", "supabase"],
@5hee75 Did you manage to resolve this? I have exactly the same problem with:
import { serve } from "https://deno.land/[email protected]/http/server.ts" import { createClient } from 'https://esm.sh/@supabase/supabase-js@2?target=deno&no-check';The edge function works just fine, but I am not able to build my next app because of this.
Are you using docker? Since CLI 1.120.0, you do need to install docker as a prerequisite for deploying functions.