Problem in auth user “First argument ”email“ must be a valid string” Ionic

I'm having trouble with my ionic signup and login page, I've did all i can to fix but i dont know the kind of error,can someone please explain, I cant login now or signup. I used firebase realtime database as backend, I cant tell what the trouble is.

code: "auth/argument-error" ​

message: "createUserWithEmailAndPassword failed: First argument "email" must be a valid string." ​

ngDebugContext: Object { view: {…}, nodeIndex: 56, nodeDef: {…}, … } ​

ngErrorLogger: function logError() ​ stack: ""


  <ion-content [fullscreen]="true" class="ion-padding">
  <div class="container">
   <div class="title">
     <span>Welcome to</span>
     <h2>Scrow Mobile App</h2>
     <p>Signup to start experiencing best bitcoin features.</p>
   <div class="form">
     <ion-icon slot="start" name="person-outline"></ion-icon>
        <ion-input type="text" placeholder="Full Name" [(ngModel)]="name"></ion-input>

        <ion-icon slot="start" name="at-circle-outline"></ion-icon> 
           <ion-input type="text" placeholder="Username" [(ngModel)]="username"></ion-input>

        <ion-icon slot="start" name="mail-outline"></ion-icon>
         <ion-input type="text" placeholder="Email" [(ngModel)]="email"></ion-input>

         <ion-icon slot="start" name="key-outline"></ion-icon>
         <ion-input type="password" placeholder="Password" [(ngModel)]="password"></ion-input>

       <ion-button expand="block" (click)="register()">
         <div class="btn-container">
           <span>Sign Up</span>
         <ion-icon name="arrow-forward-outline"></ion-icon>
     <div class="ion-text-center">
       <span>Have an account? <a [routerLink]="[ '/login']">Sign In</a></span>

import { Component, OnInit } from '@angular/core';
import { LoginService } from '../services/login.service';

  selector: 'app-register',
  templateUrl: './',
  styleUrls: ['./'],
export class RegisterPage implements OnInit {
  name: any;
  username: any;
  email: any;
  password: any;
  img: any;

    private loginService: LoginService
  ) { }

  ngOnInit() {

  register() {
    this.loginService.register(, this.username,, this.password, this.img);


import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import { AngularFireDatabase } from '@angular/fire/database';
import { auth } from 'firebase/app';

import { LoadingService } from './loading.service';
import { Platform } from '@ionic/angular';

import { environment } from 'src/environments/';
import { Router } from '@angular/router';

  providedIn: 'root'
export class LoginService {

    private afAuth: AngularFireAuth,
    private afdb: AngularFireDatabase,
    private loadingProvider: LoadingService,
    private platform: Platform,
    private router: Router,
  ) { }

  login(email, password) {
    this.afAuth.auth.signInWithEmailAndPassword(email, password).then((res) => {
    }).catch(err => {

  register(name, username, email, password, img) {;
    this.afAuth.auth.createUserWithEmailAndPassword(email, password).then((res) => {
      let user: any = this.afAuth.auth.currentUser;
      this.createNewUser(user.uid, name, username,, "I am available", "Firebase", img);
    }).catch(err => {

Thanks in advance

Read more here:

Content Attribution

This content was originally published by Marc Lovato at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: