Skip to content

Can't use FieldValues inside an Array: AsyncQueue Failed to persist write: TypeError: Cannot read property 'M' of undefined #3172

Closed
@thesandlord

Description

@thesandlord

[REQUIRED] Describe your environment

  • Operating System version: Windows 10
  • Browser version: Chrome 83.0.4103.61 (Official Build) (64-bit)
  • Firebase SDK version: 7.15.0
  • Firebase Product: Firestore

[REQUIRED] Describe the problem

When using a Firestore FieldValue in an array, for example a serverTimestamp or delete, Firestore crashes with the error:

firestore-memory:

AsyncQueue Failed to persist write: TypeError: Cannot read property 'M' of undefined

or

firstore:

AsyncQueue Failed to persist write: TypeError: Cannot read property 'B' of undefined

Steps to reproduce:

firebase.firestore().collection("test").doc("a").set({ 
  thing: [firebase.firestore.FieldValue.serverTimestamp()] 
})

PTAL at the codesandbox. Click "Bad Data" and it will crash Firestore.

Relevant Code:

https://codesandbox.io/s/simple-firestore-javascript-example-gmygz

As far as I know, this used to work

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions