Angular:
5.2.8
Firebase:
4.11.0
AngularFire:
5.0.0-rc.6
Other (e.g. Ionic/Cordova, Node, browser, operating system):
Stackblitz - chrome
Open the stackblitz
Failing test unit, Plunkr, or JSFiddle demonstrating the problem
https://stackblitz.com/edit/angular-lrgmmu
Steps to set up and reproduce
Open stackblitz
Sample data and security rules
none and allow all
Can't find module:
@firebase/firestore-types/index (@0.2.2)
Check your import statements & ensure you're importing the correct module names.
* Errors in the JavaScript console *
none
* Output from firebase.database().enableLogging(true); *
none
Is this not how you should use FieldValue.serverTimestamp() from '@firebase/firestore-types' - or maybe I am misunderstood something?
The server datetime being saved
I get this error:
Can't find module:
@firebase/firestore-types/index (@0.2.2)
Check your import statements & ensure you're importing the correct module names.
The -types packages are just types and will not work as runtime values. Use the @firebase/app module instead.
import { firebase } from '@firebase/app';
colRef.doc('testDoc').set({
name: 'testValue',
// This line works
lastEdit: firebase.firestore.FieldValue.serverTimestamp(),
// Should the following line not work?
anotherEdit: firebase.firestore.FieldValue.serverTimestamp(),
}, {merge: true})
Thanks for the help - it works.
Is there a resume somewhere about @firebase/app?
Is it correct that you now have to install _both_ firebase and @firebase/app, when using angularfire2?
@firebase/app is automatically installed when you installed firebase
Hi @sarunint thanks for clarifying that, but look at the dependency list:

Is it just me or are they not documented at all in angularfire2? When do we need the different dependencies? Do we need both firebase and @firebase/app for example?
@dauledk I'll let the Firebase JS master @jshcrowthe give you the full explanation.
@dauledk You don't need to install the @firebase/* ones since they are declared as dependencies of firebase already.
Ok - but why are they not just included in firebase then? Sorry for asking those questions, but it would be awesome with some background info about this, when suddenly the package.json changes shape complete, when just upgrading one package :)
This works for me: https://stackoverflow.com/a/59110890/1077309
Most helpful comment
The
-typespackages are just types and will not work as runtime values. Use the@firebase/appmodule instead.