© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
Louis

Typescript error with NextJs 'supabaseUrl'

So I followed the guide to create my .env.local file and set up my supaBaseClient.ts file. Everything is set up exactly as the docs suggest, but I get an error if I run my build command for the "supabaseUrl" that reads:

"Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'."

If I remove the env variables from the supabaseClient file and replace them with hard coded strings, everything seems to build/run just fine.

Has anyone run into this issue before and successfully solved it?
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

SupabaseURL
SupabaseSSupabase / help-and-questions
4y ago
NextJS - Typescript error when building it
SupabaseSSupabase / help-and-questions
4y ago
Doubt - Social Login with NextJs and Typescript
SupabaseSSupabase / help-and-questions
4y ago
Vercel deploy supabaseUrl is required
SupabaseSSupabase / help-and-questions
4y ago