Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseβ€’3y agoβ€’
6 replies
koby

[solved] CORS Error on local development with NextJS and Supabase

heyho, I've a question regarding supabase local development CORS policy.

My nextjs App is on localhost:3000 and supabase local docker container on localhost:5432X.

Everytime I make a request for data, or try to use the signup functions i get a CORS related error:

Access to fetch at 'http://localhost:54324/auth/v1/token?grant_type=password' from origin 'https://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Access to fetch at 'http://localhost:54324/auth/v1/token?grant_type=password' from origin 'https://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.


And I really can't get my head around that, I don't find any documentation or help to get my request get trough on local development.

If I use the DB directly from a supabase URL, f.ex.:
https://xxx.supabase.co
https://xxx.supabase.co
it works just fine. But i really want to operate directly on a local environment and not use the web application for my app at the moment.

The request I make for example, to login is like that:

supabase.auth.signInWithPassword({
  email: 'email@xyz.dev', 
  password: 'xyz1234',
})
supabase.auth.signInWithPassword({
  email: 'email@xyz.dev', 
  password: 'xyz1234',
})


Can somebody tell me what I do wrong here?
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

Supabase Social Sign On Auth with Local Development
SupabaseSSupabase / help-and-questions
4w ago
Google OAuth "Bad request" error on local development with Supabase CLI
SupabaseSSupabase / help-and-questions
8mo ago
Typescript error with NextJs 'supabaseUrl'
SupabaseSSupabase / help-and-questions
4y ago
Nextjs Supabase Error
SupabaseSSupabase / help-and-questions
3y ago