Skip to content

setPersistence in AngularFire _BrowserLocalPersistence cannot be invoked without 'new'` #3550

Description

@omtagline

Problem
The setPersistence method does not work when imported from @angular/fire/auth, leading to a TypeError. However, it works when imported from firebase/auth.

Error
When using the import from @angular/fire/auth, the following error is encountered:

ERROR TypeError: Class constructor _BrowserLocalPersistence cannot be invoked without 'new'
Code Example

  • Non-functional:
    import { setPersistence, browserLocalPersistence } from '@angular/fire/auth';
    await setPersistence(this.auth, browserLocalPersistence);

  • Functional:
    import { setPersistence, browserLocalPersistence } from 'firebase/auth';
    await setPersistence(this.auth, browserLocalPersistence);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions