I've installed and used AngularFire2 a lot of times for projects, but since the release of v5, I can't set it up correctly.
These are the steps I follow to reach the issue.
$ ionic start angularfire2test tabs
$ npm install angularfire2 firebase --save
package.json
"angularfire2": "^5.0.0-rc.3",
"firebase": "^4.5.2",
Add Firebase credentials to app.module.ts + import default module and database module. This is the most important part
import { AngularFireModule } from 'angularfire2';
import { AngularFireDatabaseModule } from 'angularfire2/database';
...
@NgModule({
declarations: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
AngularFireModule.initializeApp(firebaseCredentials),
AngularFireDatabaseModule
],
bootstrap: [IonicApp],
entryComponents: [
....
When I execute $ ionic serve
, I get the error message "Cannot find module "@firebase/database" at webpackMissingModule (http://localhost:8100/build/vendor.js:119190:82)
When checking the node_modules folder, @firebase doesn't have a database subfolder, but the firebase-folder does have a database-folder.
Did I do something wrong or is it a general issue with AngularFire2?
Install latest angularfire2 and [email protected]
npm install [email protected]
npm install angularfire2@latest
It is no longer necessary "--save", it remains implicit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With