Skip to content

Data cannot be encoded in JSON: path => firestore.doc(path) #964

@kelokchan

Description

@kelokchan

Related issues

[REQUIRED] Version info

node: 12

firebase-functions: 3.15.4

firebase-tools:

firebase-admin: 9.11.1

[REQUIRED] Test case

  1. Return a DocumentReference data in JSON format from a cloud function

[REQUIRED] Steps to reproduce

  1. Trigger a cloud function to return a document data that has a DocumentReference field in it

[REQUIRED] Expected behavior

  1. The document data to be returned as JSON correctly

[REQUIRED] Actual behavior

  1. Getting error when encoding the response in JSON format.
Unhandled error Error: Data cannot be encoded in JSON: path => firestore.doc(path)

Were you able to successfully deploy your functions?

Yes

Note: The error disappeared after downgrading firebase-functions to 3.14.1. The error also will not happen if I remove the DocumentReference field from the response data

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions