© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
2 replies
pid1

Importing createClient into edge function throws TS error and cannot start

I posted images of the code and errors. I removed all the code in my actual function to show it's the import statement failing.

Function code:
// Follow this setup guide to integrate the Deno language server with your editor:
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.

import { serve } from 'https://deno.land/std@0.131.0/http/server.ts';
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.0.0';
// Follow this setup guide to integrate the Deno language server with your editor:
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.

import { serve } from 'https://deno.land/std@0.131.0/http/server.ts';
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.0.0';


Error:
Download https://deno.land/std@0.165.0/node/internal_binding/_winerror.ts
Check file:///home/deno/functions/test/index.ts
error: TS2314 [ERROR]: Generic type 'PostgrestQueryBuilder<Schema, Relation>' requires 2 type argument(s).
    at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:57:126

TS2314 [ERROR]: Generic type 'PostgrestQueryBuilder<Schema, Relation>' requires 2 type argument(s).
    from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(relation: ViewName): PostgrestQueryBuilder<View>;
                                                                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:58:120

TS2314 [ERROR]: Generic type 'PostgrestQueryBuilder<Schema, Relation>' requires 2 type argument(s).
    from(relation: string): PostgrestQueryBuilder<any>;
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:59:29

TS2314 [ERROR]: Generic type 'PostgrestFilterBuilder<Schema, Row, Result>' requires 3 type argument(s).
    at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:72:9

Found 4 errors.
2022/11/21 11:28:48 Sent Header: Host [docker]
2022/11/21 11:28:48 Sent Header: User-Agent [Go-http-client/1.1]
2022/11/21 11:28:48 Send Done
2022/11/21 11:28:48 Recv First Byte
Error: error executing command
Download https://deno.land/std@0.165.0/node/internal_binding/_winerror.ts
Check file:///home/deno/functions/test/index.ts
error: TS2314 [ERROR]: Generic type 'PostgrestQueryBuilder<Schema, Relation>' requires 2 type argument(s).
    at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:57:126

TS2314 [ERROR]: Generic type 'PostgrestQueryBuilder<Schema, Relation>' requires 2 type argument(s).
    from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(relation: ViewName): PostgrestQueryBuilder<View>;
                                                                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:58:120

TS2314 [ERROR]: Generic type 'PostgrestQueryBuilder<Schema, Relation>' requires 2 type argument(s).
    from(relation: string): PostgrestQueryBuilder<any>;
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:59:29

TS2314 [ERROR]: Generic type 'PostgrestFilterBuilder<Schema, Row, Result>' requires 3 type argument(s).
    at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:72:9

Found 4 errors.
2022/11/21 11:28:48 Sent Header: Host [docker]
2022/11/21 11:28:48 Sent Header: User-Agent [Go-http-client/1.1]
2022/11/21 11:28:48 Send Done
2022/11/21 11:28:48 Recv First Byte
Error: error executing command


Execution:
supabase functions serve test --debug
supabase functions serve test --debug


Thank you for any help you can offer!
image.png
image.png
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Cannot deploy Edge Function
SupabaseSSupabase / help-and-questions
3mo ago
Cannot download edge function
SupabaseSSupabase / help-and-questions
3y ago
Importing local code into Deno + Edge Functions
SupabaseSSupabase / help-and-questions
4y ago
Cannot POST error on hello world edge function
SupabaseSSupabase / help-and-questions
3y ago