Firebase云函数从v1迁移到V2时出现的CORS错误

huangapple go评论62阅读模式
英文:

Firebase Cloud Functions Migration from v1 to V2 CORS errors

问题

我有一个使用Firebase托管和Firebase云函数的Firebase项目。
直到最近,我一直在使用V1的Firebase函数,刚刚迁移到了v2。
我已经将它们部署到云端,但现在我在所有的http onCall函数上都遇到了CORS错误。我在V1函数中从未遇到过这个问题。

由于我在同一个Firebase项目中同时使用Firebase托管和Firebase函数,我看不出为什么会出现CORS错误。

这是错误信息:
Firebase云函数从v1迁移到V2时出现的CORS错误

如果有人知道可能出现的问题是什么,我将非常感激帮助。

英文:

I have a Firebase project that uses Firebase hosting along with Firebase cloud functions.
Up until recently I have been using V1 firebase functions, and just now migrated to v2.
I've got them deployed to the cloud, but now I'm getting CORS errors for all my http onCall functions. I never had this problem with V1 functions.

Since I'm using Firebase hosting and Firebase functions all from the same Firebase project, I can't see why there would be a CORS error.

Here's the Error:
Firebase云函数从v1迁移到V2时出现的CORS错误

If anyone knows what the problem might be, I'd greatly appreciate the help.

答案1

得分: 2

onCall函数部署在与我的Firebase项目不同的地区。一旦我将onCall函数部署在与我的Firebase项目相同的地区,错误就消失了。

英文:

The onCall functions were deployed in a different region than my firebase project. Once I deployed the onCall functions in the same region as my firebase project, the errors went away.

huangapple
  • 本文由 发表于 2023年5月24日 17:54:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76322240.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定