Skip to content

Upgrade to angular 20 gives issues with AngularFire: Cannot read properties of undefined (reading 'then') #3654

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

Open
LanderBeeuwsaert opened this issue May 28, 2025 · 7 comments

Comments

@LanderBeeuwsaert
Copy link

LanderBeeuwsaert commented May 28, 2025

During our upgrade to Angular 20, our project compiles successfully
However the moment we go to the application/website, angularFire gives issues.
In chrome devtools we see:

Image

it seems to be this line that is failing:

Image

I got curious and tried out with zoneless and still got the same error, but it's just a little more readible:

Image

Is angularFire considered to be already compatible with Angular 20?
Anybody else experiencing the same?

@google-oss-bot
Copy link

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

@anisabboud
Copy link

anisabboud commented May 29, 2025

Seeing this error with Firestore getDoc (broken in Angular 20 zoneless).

TypeError: Cannot read properties of undefined (reading 'then')

getToken is also broken (also returns a Promise like getDoc).

@jamesdaniels
Copy link
Member

Not supported yet, that was a breaking change I need to find a mitigation to. Hopefully should have a release candidate to test shortly.

@jamesdaniels
Copy link
Member

Please give the RC a spin, @angular/[email protected] published on NPM @next. I'll cut next week if there aren't any show stoppers.

@anisabboud
Copy link

The rc.0 version seems to resolve the type errors in getDoc and getToken. Also no longer need to do "overrides": { "rxjs": "7.8.2" } in package.json to make 'canActivate' in auth-guard/auth-guard.d.ts compile.

Thank you!

@LanderBeeuwsaert
Copy link
Author

@jamesdaniels works, thanks!

@damiansire
Copy link

Please give the RC a spin, @angular/[email protected] published on NPM @next. I'll cut next week if there aren't any show stoppers.

I'm trying it from there, thanks!

If anyone wants to try it in a new project and doesn't know how, they simply need to add @next in the schematics or installation:

ng add @angular/fire@next

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

5 participants