Function DocumentReference.set() called with invalid data. Data must be an object, but it was: a custom Object object
firebase.firestore().collection("foo").doc("bar").set({})
Object.assign({}, obj)
JSON.parse(JSON.stringify(obj))
>This is likely a cross-window issue: GWT code runs in an iframe; if Firebase is looking for a "bare object", it likely compares the object's constructor, which won't be the expected one if the object crosses the iframe boundary.