angularfire: AngularFire 7.2 doesn't compile with latest Angular 13.1 and Typescript 4.5
Update Angular & Typescript to latest (13.1.0 and 4.5.3) => ng serve
errors in the terminal:
Error: node_modules/@angular/fire/compat/proxy.d.ts:7:49 - error TS2344: Type ‘T[K]’ does not satisfy the constraint ‘(…args: any) => any’.
Caused by this file: https://github.com/angular/angularfire/blob/master/src/compat/proxy.ts Latest version of Typescript (4.5.3) doesn’t like T[K].
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 18
- Comments: 21 (2 by maintainers)
Commits related to this issue
- fix: :bug: add "skipLibCheck": true to fix compile error fix error "Type 'T[K]' does not satisfy the constraint '(...args: any) => any'" open issue at github firebase https://github.com/angular/angul... — committed to JavaVista/chat-me by deleted user 2 years ago
- fix: skipLibCheck - ref. https://github.com/angular/angularfire/issues/3090 — committed to kasaharu/kanban by kasaharu 2 years ago
- Update compiler options Workaround for https://github.com/angular/angularfire/issues/3090 — committed to k0swe/forester by xylo04 2 years ago
- Update dependency typescript to v4.5.5 (#822) * Update dependency typescript to v4.5.5 * Update compiler options Workaround for https://github.com/angular/angularfire/issues/3090 Co-authored... — committed to k0swe/forester by renovate[bot] 2 years ago
- skip library checks due to errors in @angular/fire/compat/proxy - https://github.com/angular/angularfire/issues/3090 — committed to ubreu/firebase-scaffolding by deleted user 2 years ago
Set
skipLibCheck: true
in your tsconfig for now.A temporary fix for this is to revert typescript back to 4.4.4:
npm install typescript@4.4.4
skipLibCheck: true
worked for me!I’m also having the same problem:
Version info
Angular: 13.1.1
Firebase: 9.0.0
AngularFire: 7.0.4
Other (e.g. Ionic/Cordova, Node, browser, operating system): Chrome
How to reproduce these conditions
Failing test unit, Stackblitz demonstrating the problem
N/A
Upgrade to Typescript 4.5.3, Angular 13.1.1, AngularFire 7.0.4
Sample data and security rules
N/a
Debug output
** Errors in the JavaScript console **
Error: node_modules/@angular/fire/compat/proxy.d.ts:7:49 - error TS2344: Type ‘T[K]’ does not satisfy the constraint ‘(…args: any) => any’. Type ‘T[FunctionPropertyNames<T>]’ is not assignable to type ‘(…args: any) => any’. Type ‘T[T[keyof T] extends Function ? keyof T : never]’ is not assignable to type ‘(…args: any) => any’. Type ‘T[keyof T]’ is not assignable to type ‘(…args: any) => any’. Type ‘T[string] | T[number] | T[symbol]’ is not assignable to type ‘(…args: any) => any’. Type ‘T[string]’ is not assignable to type ‘(…args: any) => any’.
7 [K in FunctionPropertyNames<T>]: ReturnType<T[K]> extends Promise<any> ? K : never;
** Output from
firebase.database().enableLogging(true);
** N/A** Screenshots **
Expected behavior
Angular app compiles without any problems.
Actual behavior
Angular App no longer compiles
Same problem here!
Cutting 7.2.1 with the fix now
Add this 2 lines inside compilerOptions in your tsconfig.json
“skipDefaultLibCheck”: true, “skipLibCheck”: true,
skipLibCheck: true
did NOT work for me.skipLibCheck: true
must be insidecompilerOptions
@GoSkiMNCan confirm the issue with : “@angular/core”: “~13.1.1”, “@angular/fire”: “^7.2.0”,