Firebase-js-sdk: Response data is missing data field after preflight response

Created on 27 Oct 2018  路  10Comments  路  Source: firebase/firebase-js-sdk

Describe your environment

  • Operating System version: ubuntu
  • Browser version: chrome
  • Firebase SDK version: "firebase": "^5.5.6",
  • Firebase Product: functions

Describe the problem

after a preflight response from the firebase function I get this error from the sdk

 Error: Response is missing data field.
    at new HttpsErrorImpl (index.cjs.js:58)
    at Service.<anonymous> (index.cjs.js:504)

I can not call the firebase functions from my app. I don't know how to deal with this pre-flight issue. Maybe there's another way to do it on firebase.

functions closed-by-bot needs-info no-recent-activity

Most helpful comment

Same here, any updates?

EDIT:
Actually that issue is gone when I use a object with property data in response of the firebase function:
res.status(200).send({ data: { ... } })

All 10 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Any updates on this issue? I'm badly stucked at this.

Same here, any updates?

EDIT:
Actually that issue is gone when I use a object with property data in response of the firebase function:
res.status(200).send({ data: { ... } })

@mrvnklm do you mean that the server must respond with data to the preflight response?

@rafinskipg no, the firebase function response must contain data object. I mean, this could be a real issue but it fixes the problem without any compromises

@mrvnklm , interesting... I stopped using this SDK long ago, because of this problem, but maybe i dare to try again someday. Thanks for your insights

Firebase documentation requires the json with a data field.

@rafinskipg could you confirm if you are still having this issue? If so, would you mind sharing the detailed steps you鈥檝e taken that led to the error message encountered (with a sample reproducible code would be great).

You may also consider upgrading your JS SDK to the latest version.


Hey @rafinskipg. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!


Since there haven't been any recent updates here, I am going to close this issue.

@rafinskipg if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

Was this page helpful?
0 / 5 - 0 ratings