Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find @angular/fire/firestore module error in VScode

I am very new to firebase firestore. And this is my first project with firestore. I installed angular fire with this command

npm install firebase @angular/fire --save

and now importing the angularfiremodule like this

import { AngularFireModule } from '@angular/fire';

and angularfirestoremodule like this

import { AngularFirestoreModule } from '@angular/fire/firestore';

But this is giving me error

Cannot find module '@angular/fire'.ts(2307)

Any idea what might be the error? I tried google searching but since I am new to firebase, everything seems very mixed up to me. Also, I'm using ionic version 4, Angular version 8.1.3 and node version 10.16.3 if that makes any difference.

Angularfire2 was working fine previously, but since it's deprecated, I want to move to angular/fire.

like image 325
Ramsha Khalid Avatar asked Jun 12 '26 05:06

Ramsha Khalid


1 Answers

I solved the problem by using below import statement, in app.module.ts

import { AngularFirestoreModule } from '@angular/fire/compat/firestore/'; 
like image 160
Muhammad Shahab Avatar answered Jun 15 '26 01:06

Muhammad Shahab