Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

130
Views
Firebase Functions CORS Policy Disallowing Calls

I've been using Firebase functions emulator to develop the following function and had no issue running it from localhost.

exports.functionName = functions.https.onCall(async (data, context) => {
    const var1 = data.var1
    const var2 = data.var2

    const paymentIntent = await object1.property1.function1({
        ...
    });

    return({
        clientSecret: paymentIntent.client_secret
    })
})

Now that I deployed it on firebase (on the default url of projectName.web.app), when I reach the code which fetches this function, I get the following error:

Access to fetch at 'https://us-central1-projectName.cloudfunctions.net/functionName' from origin 'https://projectName.web.app' 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.

Why am I getting this error, especially if it's coming from a call made on deployed website hosted by firebase? What can I do to get through this, and will that open me up to any security risks?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!