I am not sure if this is a bug, but after upgrading to [email protected] I get this strange error on our spread operators. I created a small stackblitz that illustrates how we use the snapshotChanges() in our project. If you install [email protected] there are no errors.
Angular: 6
Firebase: 5.0.2
AngularFire: 5.0.0-rc.9
https://stackblitz.com/edit/spread-operator-error
Open stackblitz

No error
Typescript gives error
ERROR in <path-to-file>: error TS2698: Spread types may only be created from object types.
This was a breaking change in RC 9, we fixed the typings :P
Your data object is now a Shirt. Odd that it's not spreading for you, you might want to look at your Shirt interface... I'll play around with this in my test project.
In the meantime you could do ...(data as {})
Thanks for the quick response.
Am also playing around, and the suggeste fix work.
I think it boils down to my (limited) understanding of functions that handle types dynamically. Like the queryCollection function should probably have a return signature, of a different type than, say, Observable But thanks anyway!
Ah, so yeah you're losing the type information when you pass the reference + the default is any
I forked your StackBlitz and altered it to achieve what I think you're looking for https://stackblitz.com/edit/spread-operator-error-j5r6nm?file=src/app/app.component.ts
Most helpful comment
This was a breaking change in RC 9, we fixed the typings :P
Your
dataobject is now aShirt. Odd that it's not spreading for you, you might want to look at yourShirtinterface... I'll play around with this in my test project.In the meantime you could do
...(data as {})