英文:
Firebase Cloud Functions Migration from v1 to V2 CORS errors
问题
我有一个使用Firebase托管和Firebase云函数的Firebase项目。
直到最近,我一直在使用V1的Firebase函数,刚刚迁移到了v2。
我已经将它们部署到云端,但现在我在所有的http onCall函数上都遇到了CORS错误。我在V1函数中从未遇到过这个问题。
由于我在同一个Firebase项目中同时使用Firebase托管和Firebase函数,我看不出为什么会出现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:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论