firebase-tools: Error: Unable to parse JSON: SyntaxError: Unexpected token < in JSON at position 0

[REQUIRED] Environment info

10.1.4

firebase-tools:

macOS

Platform:

n/a

[REQUIRED] Test case

firebase deploy --only functions:[FUNCTION_NAME]

[REQUIRED] Steps to reproduce

Deploy code to Firebase.

[REQUIRED] Expected behavior

Successful deployment.

[REQUIRED] Actual behavior

Error: Unable to parse JSON: SyntaxError: Unexpected token < in JSON at position 0

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 26 (13 by maintainers)

Most upvoted comments

i face same issue today firebase -V 12.5.4, seems no way to handle this.

@JFGHT Huh maybe there was some other bug that ended up being cleaned up in the fix. One unlikely possibility is that the source upload response was returning some form of XML response in some cases.

Regardless, glad your pipeline is healthy again.

Firebase CLI v.10.2.1 just released w/ https://github.com/firebase/firebase-tools/issues/4146. Can you try using the latest CLI version in your CI pipeline? You’ll likely get more useful error message.

Psychic debugging: GCS supports AWS S3’s APIs, which are XML based. It’s possible that the error message we’re getting here is in XML. The XML error is likely telling you that 100MB is larger than the limit allowed by the signed upload request.

Yes to better error messages.

@tfang17 I think you might be hitting resource limit of Google Cloud Functions - you cannot deploy your source that’s greater than 100MB (compressed):

https://cloud.google.com/functions/quotas#resource_limits