Reproducing the issue
The following code snippet call the createUserWithEmailAndPassword() method to create a new user with an email and password.
const credentials = await this.auth.createUserWithEmailAndPassword(
email,
password
);
Error
Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'. Type 'undefined' is not assignable to type 'string'.ts(2345)
Solution
Use type assertion.
const credentials = await this.auth.createUserWithEmailAndPassword(
email as string,
password as string
);