Skip to content

Failed to parse response data #49

@taina0407

Description

@taina0407
  • Operating System version: Ubuntu 16.04
  • Firebase SDK version: ____
  • Library version: 5.0.0
  • Firebase Product: notification

[REQUIRED] Step 3: Describe the problem

I'm using firebase-admin to fire FCM notifications to iOS and Androids clients. The module work fine but some time throw exception "Failed to parse response data"
I've tried to search but seem no one report it before and I don't know why it's happen.

Steps to reproduce:

Fire FCM notification

fcmSender.messaging().sendToDevice(registrationTokens, fcmPayload, fcmOptions)

Here is trace log:

Error: Failed to parse response data: "SyntaxError: Unexpected end of JSON input". Raw serverresponse: "."
  File "/backend/node_modules/firebase-admin/lib/utils/error.js", line 39, col 28, in FirebaseAppError.FirebaseError [as constructor]
    var _this = _super.call(this, errorInfo.message) || this;
  File "/backend/node_modules/firebase-admin/lib/utils/error.js", line 84, col 23, in new FirebaseAppError
    return _super.call(this, {
  File "/backend/node_modules/firebase-admin/lib/utils/api-request.js", line 104, col 48, in IncomingMessage.<anonymous>
    var parsingError = new error_1.FirebaseAppError(error_1.AppErrorCodes.UNABLE_TO_PARSE_RESPONSE, "Failed to parse {snip}
  File "events.js", line 110, col 20, in emitNone
  File "events.js", line 207, col 7, in IncomingMessage.emit
  File "_stream_readable.js", line 1047, col 12, in endReadableNT
  File "internal/process/next_tick.js", line 102, col 11, in _combinedTickCallback
  File "internal/process/next_tick.js", line 198, col 9, in process._tickDomainCallback

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions