Short answer
HTTP functions have no CORS policy by default, so browsers block calls from other sites. Set the cors option on the function to your app’s domains, or to true only for a public API. Callable functions allow all origins by default, so a CORS error there often means the request never reached your code: check the function name, region and deploy before touching CORS.
Why the browser blocks it, and the fix
01
An HTTP function with no cors option
“By default, HTTP functions don't have CORS configured, meaning that any cross-origin request to your function results in this error” Firebase, Call functions via HTTP requests
An onRequest function rejects cross-origin calls from browsers unless you set cors. List the domains that should call it, such as your production domain and localhost while developing, rather than allowing every origin.
02
cors set to true on a private endpoint
“If your function should be openly available, for example if it's serving a public API or website, set the cors policy to true.” Firebase, Call functions via HTTP requests
true lets any website call the function from a visitor’s browser. Keep it for endpoints that really are public, and check sign-in inside the function either way, since CORS only limits browsers.
03
A callable function that fails before CORS
“By default, callable functions have CORS configured to allow requests from all origins.” Firebase, Call functions from your app
Callable functions already allow all origins unless you change it, so a CORS error can be a symptom of something else: a function name that doesn’t exist, a different region from the one the client calls, a function that didn’t deploy, or a crash. Check the function logs and the region in your client code.
Checked against the vendor’s docs on : Firebase docs: Call functions via HTTP requests (CORS); Firebase docs: Call functions from your app (callable).
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.See scope and start
Related: Supabase Edge Function CORS error · Firebase auth/unauthorized-domain · Firebase App Check blocking requests