Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AngularFire 7.2 doesn't compile with latest Angular 13.1 and Typescript 4.5 #3090

Closed
anisabboud opened this issue Dec 10, 2021 · 21 comments
Closed

Comments

@anisabboud
Copy link

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'.
image

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].

@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@ProtoScott
Copy link

ProtoScott commented Dec 10, 2021

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]' 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]: ReturnType<T[K]> extends Promise ? K : never;

** Output from firebase.database().enableLogging(true); **
N/A

** Screenshots **

image

Expected behavior

Angular app compiles without any problems.

Actual behavior

Angular App no longer compiles

@ProtoScott
Copy link

A temporary fix for this is to revert typescript back to 4.4.4:

npm install typescript@4.4.4

@Ahmed4812
Copy link

Same problem here!

@Helioty
Copy link

Helioty commented Dec 13, 2021

Same problem

@justjoshin83
Copy link

i am having the same issue. Any assistance would be much appreciated

@MohammedLahkime
Copy link

Same issue with the following
angular : 3.1.0",
"@angular/fire": "^7.2.0",
"firebase": "^9.0.0",
"rxfire": "^6.0.0"

@carlosdag28
Copy link

Same issue with the following:
"@angular/core": "~13.1.0",
"@angular/fire": "^7.2.0",
"firebase": "^9.6.1"

@jamesdaniels
Copy link
Member

Set skipLibCheck: true in your tsconfig for now.

@Darrow8
Copy link

Darrow8 commented Dec 18, 2021

skipLibCheck: true worked for me!

@mikgross
Copy link

Thanks @jamesdaniels !!

@GoSkiMN
Copy link

GoSkiMN commented Jan 3, 2022

skipLibCheck: true did NOT work for me.

@Li0n-0
Copy link

Li0n-0 commented Jan 7, 2022

skipLibCheck: true must be inside compilerOptions @GoSkiMN

Can confirm the issue with :
"@angular/core": "~13.1.1",
"@angular/fire": "^7.2.0",

@fennrussel
Copy link

Add this 2 lines inside compilerOptions in your tsconfig.json

"skipDefaultLibCheck": true,
"skipLibCheck": true,

JavaVista pushed a commit to JavaVista/chat-me that referenced this issue Jan 14, 2022
fix error "Type 'T[K]' does not satisfy the constraint '(...args: any) => any'" open issue at github firebase angular/angularfire#3090
kasaharu added a commit to kasaharu/kanban that referenced this issue Jan 16, 2022
@Mutti-u-rehman
Copy link

npm install typescript@4.4.4

Thanks

xylo04 added a commit to k0swe/forester that referenced this issue Jan 22, 2022
xylo04 added a commit to k0swe/forester that referenced this issue Jan 22, 2022
* Update dependency typescript to v4.5.5

* Update compiler options

Workaround for angular/angularfire#3090

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Chris Keller <xylo04@gmail.com>
@EmmanuelDeLaion
Copy link

I put "skipLibCheck": true inside compilerOptions in the tsconfig.json file and it works for me for now

@MrMartinez
Copy link

Set skipLibCheck: true in your tsconfig for now.

Al principo no me funcinaba porque estaba corriendo el ng build, ahi seguia el error; pero con ng serve la corre normal

@IslamElKassas
Copy link

Updating typescript to v4.5.5 does not work, skipLibCheck : true worked for me

@fetahokey
Copy link

Same here, thank you @ProtoScott

@NashIlli
Copy link

NashIlli commented Feb 4, 2022

same problem here!

@jamesdaniels
Copy link
Member

Cutting 7.2.1 with the fix now

ubreu pushed a commit to ubreu/firebase-scaffolding that referenced this issue Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests