I recently updated my Angular 5 project to Angular 6 and I've been trying to build and deploy all day. My latest problem is one with importing - it was working fine before.
The error now says cannot find module 'firebase'
in my import.
We'll be able to create, delete tasks, and transfer them from one category to another using drag and drop. We'll develop the user interface using Angular and use Firestore as our persistent store. At the end of the codelab we'll deploy the app to Firebase Hosting using the Angular CLI.
Before start Firebase integration in Angular 8. We need a Angular 8 Project. If you don’t know how to create a new angular 8 project. Follow this tutorial. To make any type of interaction with the Firebase server you need firebase module. To install it type the below command and hit enter, will install the firebase module
Sign in to your account Firebase SDK version: 6.28.1 Firebase Component: Whole Firebase framework (Auth, Core, Database, Firestore, Messaging, Storage, etc) Component version: 6.28.1 Just install firebase with some components like functions and firestore, then try to use firestore/functions with imported Firesbase.
These are unique to each Firebase Project and I am going to show you how to get them for your Firebase project, by following the steps below: The first step is to go to the settings of your project. At the bottom of the Projects’ Setting Web Page, you will see a list of “Your Apps” section.
Using the compat libraries during upgrade allows you to continue using version 8 code alongside code refactored for version 9. This means you can keep existing version 8 code for Cloud Firestore while you refactor Authentication or other Firebase SDK code to the version 9 style, and still successfully compile your app with both code styles.
For Angular 6+ import firebase core and services as follows:
/*
* reduce the amount of code that your app uses by
* only including the features that you need.
*/
// import core firebase client (required)
import firebase from '@firebase/app';
// import Firebase Authentication (optional)
import '@firebase/auth';
// import Firebase Realtime Database (optional)
import '@firebase/database';
// import Cloud Firestore (optional)
import '@firebase/firestore';
Se official docs for more information.
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