Firebase Callable Function + CORS

后端 未结 9 1239
Happy的楠姐
Happy的楠姐 2020-12-15 04:52

I\'m trying to call a callable Cloud Function from my app, but I\'m facing CORS issues.

I can\'t enable Cors since I don\'t have access to the request and response

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-15 05:31

    I had this problem with some of my Firebase functions but not others. I eventually fixed it by doing this:

    1. Commenting the function out in index.js
    2. Running firebase deploy
    3. Entering y at the prompt to delete the function
    4. Waiting for 5 to 10 minutes
    5. Removing the comments around the function and running firebase deploy again

    Without any changes to the function itself, it now runs without any CORS issues.

提交回复
热议问题