I am using Firebase functions and exposing them through the following Firebase hosting rewrites:
{
"hosting": {
"public": "build",
"headers": [
{
"source": "/service-worker.js",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache"
}
]
}
],
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
// functions
{ "source": "/mappedUrlOne", "function": "functionOne" },
{ "source": "/mappedUrlTwo", "function": "functionTwo" },
// landing page
{
"source": "**",
"destination": "/index.html"
}
]
}
When running repeated calls against the mapped URL (e.g. /mappedUrlOne
) the functions intermittently fail about 50% of the time with a 500 Internal Error
. The dropped requests don't even register in the Firebase logs and fail within 200-300ms.
If I call the function directly (e.g. https://us-central1-my-project-name.cloudfunctions.net/functionOne
) everything goes smoothly.
The mappings have been deployed and working for a while, maybe over a year, so nothing's changed there.