Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Couldn't serialize object of type "NumericIncrementTransform" (found in field "count") #16

@vhanded

Description

@vhanded

I am having this issue when calling fulltextsearch.set()

Error: Value for argument "data" is not a valid Firestore document. Couldn't serialize object of type "NumericIncrementTransform" (found in field "count"). Firestore doesn't support JavaScript objects with custom prototypes (i.e. objects that were created via the "new" operator).
    at validateUserInput (/home/vhanded/Development/flow/functions/node_modules/@google-cloud/firestore/build/src/serializer.js:311:15)
    at Object.validateUserInput (/home/vhanded/Development/flow/functions/node_modules/@google-cloud/firestore/build/src/serializer.js:260:13)
    at validateDocumentData (/home/vhanded/Development/flow/functions/node_modules/@google-cloud/firestore/build/src/write-batch.js:641:18)
    at WriteBatch.set (/home/vhanded/Development/flow/functions/node_modules/@google-cloud/firestore/build/src/write-batch.js:251:9)
    at WriteBatch2.commit (/home/vhanded/Development/flow/node_modules/firestore-full-text-search/lib/utils/firestore.js:68:38)
    at FirestoreFullTextSearch.set (/home/vhanded/Development/flow/node_modules/firestore-full-text-search/lib/index.js:205:21)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /home/vhanded/Development/flow/functions/lib/customerEvents.js:64:9
    at async runFunction (/home/vhanded/.nvm/versions/node/v16.3.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:583:9)
    at async runBackground (/home/vhanded/.nvm/versions/node/v16.3.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:595:5)
    at async processBackground (/home/vhanded/.nvm/versions/node/v16.3.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:578:5)
    at async invokeTrigger (/home/vhanded/.nvm/versions/node/v16.3.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:653:13)
    at async handleMessage (/home/vhanded/.nvm/versions/node/v16.3.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:741:9)

This is the environment I am using:

Angular CLI: 12.0.5
Node: 16.3.0
Package Manager: npm 7.15.1
OS: linux x64

Angular: 12.0.5
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1200.5
@angular-devkit/build-angular   12.0.5
@angular-devkit/core            12.0.5
@angular-devkit/schematics      12.0.5 (cli-only)
@angular/fire                   6.1.5
@ngtools/webpack                12.0.5
@schematics/angular             12.0.5 (cli-only)
rxjs                            6.6.7
typescript                      4.2.4

I don't have 'count' field in my data, and I have no idea why this is happening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions