PR https://github.com/firebase/firebase-js-sdk/pull/529 should have also updated https://github.com/firebase/firebase-js-sdk/blob/d59b72493fc89ff89c8a17bf142f58517de4c566/packages/firebase/app/index.d.ts#L204-L206 to add the signInMethod: string; field.
This was done in some places, but not all of them
https://github.com/firebase/firebase-js-sdk/blob/a3c6335deedc99a4532d0fe01406241cdb2b88c1/packages/auth-types/index.d.ts#L97-L100
Upgrade firebase from 4.11.0 to 4.12.0 and @firebase/auth from 0.3.4 to 0.4.0.
ERROR in src/app/users.service.ts(191,43): error TS2345: Argument of type 'firebase.auth.AuthCredential' is not assignable to parameter of type 'AuthCredential'.
Property 'signInMethod' is missing in type 'AuthCredential'.
import * as firebase from 'firebase/app';
...
signInWithCredential(credential: firebase.auth.AuthCredential): void {
this.fbAuth.auth.signInWithCredential(credential) <-- this argument's type causes the error
...
My IDE doesn't present this as an option, but removing firebase.auth from the first use of the type and adding the following import, seems to solve the error.
import {AuthCredential} from '@firebase/auth-types';
@Splaktar Thanks for reporting this. I have a fix in PR #583. But unfortunately you'll have to wait until next week's release to use it. Sorry for the inconvenience.
No problem. The workaround is working for me. Hopefully not many others will hit it between now and the new release 馃槃
Hello! I've hit said wall. Does anyone know if this has been fixed? Also, @Splaktar can you elaborate a little more on your workaround?
@TheCorbin here's the exact steps that I used for the workaround:
import * as firebase from 'firebase/app';
...
signInWithCredential(credential: firebase.auth.AuthCredential): void {
this.fbAuth.auth.signInWithCredential(credential)
...
import * as firebase from 'firebase/app';
import {AuthCredential} from '@firebase/auth-types';
...
signInWithCredential(credential: AuthCredential): void {
this.fbAuth.auth.signInWithCredential(credential)
...
@TheCorbin this was fixed in [email protected].
Most helpful comment
@Splaktar Thanks for reporting this. I have a fix in PR #583. But unfortunately you'll have to wait until next week's release to use it. Sorry for the inconvenience.