I have created Angular project
ng new <projectname>
Then installed Angular fire
ng add @angular/fire
When I compile and run the project
ng serve
I am seeing the below error
Build at: 2022-05-07T07:48:29.607Z - Hash: dcd59b9e5be0333c - Time: 19924ms
Error: node_modules/@firebase/auth/dist/auth-public.d.ts:3137:22 - error TS2304: Cannot find name 'PhoneOrOauthTokenResponse'.
3137 _tokenResponse?: PhoneOrOauthTokenResponse;
~~~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/@firebase/auth/dist/auth-public.d.ts:3429:11 - error TS2304: Cannot find name 'UserInternal'.
3429 user: UserInternal;
~~~~~~~~~~~~
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
✖ Failed to compile.
My Angular version looks like below. Do I need to degrade the version of Angular?
Angular CLI: 13.3.5
Node: 16.15.0
Package Manager: npm 8.5.5
OS: linux x64
Angular: 13.3.6
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1303.5
@angular-devkit/build-angular 13.3.5
@angular-devkit/core 13.3.5
@angular-devkit/schematics 13.3.5
@angular/cli 13.3.5
@angular/fire 7.3.0
@schematics/angular 13.3.5
rxjs 7.5.5
typescript 4.6.4
CodePudding user response:
I started having this problem too after updating eslint packages to the latest. In my project, downgrading them to these versions solves the compilation errors:
With @angular/fire being on v.7.3.0:
@eslint/eslintrc --> 1.2.2 (problem started on 1.2.3)
eslint --> 8.14.0 (problem started on 8.15.0)
CodePudding user response:
I had the same problem. I think it's a problem with version 0.20.
I solve it just running:
npm i @firebase/auth@^0.18.3