Unusual problem with Firebase functions CORS (unhandled rejection/CORS)

Yes, most of the time, you have an error in your function that’s not related to CORS. If you are hosting your app with firebase hosting, your can rewrites your urls (firebase.json) to call a specific cloud function, removing the need for CORS since it uses the same origin (https://firebase.google.com/docs/hosting/functions#direct-requests-to-function):

"rewrites": [
        "source": "/api/v1/**",
        "function": "functionName"

That could help you to actually know what is wrong with your function.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top