I'm trying to deploy a firebase cloud function. On deployment from the CLI, there was a success message, and no errors were shown.
All the other functions in this project work fine, it's just this function that doesn't.
When I try to call this function from my app I get a CORS error:
POST https://{url}/volunteering-searchPeople net::ERR_FAILED
To debug the function, I stripped everything out and it's now just this:
const searchPeople = functions.region('europe-west1').https.onCall(async (data, context) => {
const {
managedBy,
helpPage,
contactStatus,
needs,
postcode,
noVolunteers
} = data;
return Promise.resolve('done');
})
It's called from the app here:
const testFunction = functions.httpsCallable('volunteering-testFunction')
testFunction().then((result) => console.log({result}))
It works when it's run emulated on localhost. When you go to the URL directly there's this message (which is different to the error message returned by all the other functions in this project):
Error: Forbidden
Your client does not have permission to get URL /volunteering-searchPeople from this server.
When you go to that URL, nothing appears in the logs. If I run a test directly from the Google cloud functions console, it does show up in the cloud function logs, but that seems to be the only way to actually run this function.
Edit: This now happens for all new functions I try to deploy
Edit2: This error only appears for functions deployed in europe-west1 or europe-west2. New functions in us-central1 work fine.