Skip to content

serverTimestamp is undefined after upgrading from v10 to v11 #1799

@abedzantout

Description

@abedzantout

[READ] Step 1: Are you in the right place?

  • For issues related to the code in this repository file a Github issue.
  • If the issue pertains to Cloud Firestore, read the instructions in the "Firestore issue"
    template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: MacOS 12.4
  • Firebase SDK version: 11
  • Firebase Product: admin and functions (auth, database, storage, etc)
  • Node.js version: ^16
  • NPM version: ^8

[REQUIRED] Step 3: Describe the problem

Upgrading from v10 to v11 breaks admin.firestore.FieldValue.serverTimestamp(); functionality.

Steps to reproduce:

Run any set, add, update on collection, and include a timestamp on cloud function.

Downgrading back to v10 works.

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

TypeError: Cannot read properties of undefined (reading 'serverTimestamp')

Relevant Code:

`collection('any').add({createdAt: admin.firestore.FieldValue.serverTimestamp()})` 

I apologize if this was mentioned somewhere else or if there are migration steps in the changelog.

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