Supabase edge functions deno - Cannot find module in next js

957 Views Asked by At

I'm using Next 13.4 and typescript. I have a supabase edge function where I import from 2 different modules:

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 function works well, but these import don't allow me to build my app and deploy it giving these errors which are technically the same:

Cannot find module 'https://deno.land/[email protected]/http/server.ts' or its corresponding type declarations.
Cannot find module 'https://esm.sh/@supabase/supabase-js@2?target=deno&no-check' or its corresponding type declarations.

I've seen the same issue here: https://github.com/supabase/supabase-js/issues/744

But no answer to it.

1

There are 1 best solutions below

0
On

You can add supabase to the exclude section of tsconfig.json

"exclude": ["node_modules", "supabase"],