Skip to content

Uncaught TypeError: Cannot assign to read only property 'settings' of object '[object Object]' #2826

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

Closed
xiongemi opened this issue May 13, 2021 · 4 comments

Comments

@xiongemi
Copy link

Version info

Angular: 11.2.14

Firebase: 8.6.1

AngularFire: 6.1.4

Other (e.g. Ionic/Cordova, Node, browser, operating system):

How to reproduce these conditions

Failing test unit, Stackblitz demonstrating the problem

Steps to set up and reproduce

when adding settings to auth followed instructions at https://github.com/angular/angularfire/blob/master/docs/auth/getting-started.md

import { SETTINGS as AUTH_SETTINGS } from '@angular/fire/auth';

@NgModule({
  // ... Existing configuration
  providers: [
    // ... Existing Providers
    { provide: AUTH_SETTINGS, useValue: { appVerificationDisabledForTesting: true } },
  ]
})
export class AppModule { }

it throws an error for line { provide: AUTH_SETTINGS, useValue: { appVerificationDisabledForTesting: true } },, remove this line and the error is gone.

Sample data and security rules

Debug output

** Errors in the JavaScript console **

** Output from firebase.database().enableLogging(true); **

in the browser, it throws:

Uncaught TypeError: Cannot assign to read only property 'settings' of object '[object Object]'
    at angular-fire-auth.js:134
    at ɵfetchInstance (angular-fire.js:460)
    at angular-fire-auth.js:113
    at ZoneDelegate.invoke (zone-evergreen.js:364)
    at Zone.run (zone-evergreen.js:123)
    at NgZone.runOutsideAngular (core.js:28520)
    at MapSubscriber.project (angular-fire-auth.js:105)
    at MapSubscriber._next (map.js:29)
    at MapSubscriber.next (Subscriber.js:49)
    at MapSubscriber._next (map.js:35)

** Screenshots **

Expected behavior

Actual behavior

@KingDarBoja
Copy link
Contributor

Seems to me it is caused by how the firebase-js-sdk defined the settings property in the auth prototype: firebase-js-sdk/auth.

fireauth.object.setReadonlyProperty(this, 'settings', new fireauth.AuthSettings())

@KingDarBoja
Copy link
Contributor

Please update to next version (v6.1.5) which contains this fix 🚀

@GrandSchtroumpf
Copy link

@KingDarBoja looks like version 6.1.5 is not on npm yet.

image

@jamesdaniels
Copy link
Member

Github Actions has been degraded all morning, sorry about that, our CI/CD should be caught up soon.

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

4 participants