Reference.child failed: First argument was an invalid path


Reference.child failed: First argument was an invalid path = “undefined”. Paths must be non-empty strings and can’t contain “.”, “#”, “$”, “[”, or “]”

any solution with this code…plis help me

import { Component } from ‘@angular/core’;
import { IonicPage, NavController, LoadingController, ToastController, NavParams } from ‘ionic-angular’;
import { UserserviceProvider } from ‘…/…/providers/userservice/userservice’;
import { HomePage } from ‘…/home/home’;


selector: ‘page-register’,
templateUrl: ‘register.html’,
providers: [UserserviceProvider]
export class RegisterPage {

public first_name : any;
public last_name : any;
public email : string;
public password : any;
public phone : any;
public state : any;

constructor(public navCtrl: NavController, public navParams: NavParams,
public usersserviceProvider : UserserviceProvider,
public toastCtrl: ToastController, public loadingCtrl: LoadingController) {

ionViewDidLoad() {
console.log(‘ionViewDidLoad RegisterPage’);


 var account = {
   first_name: this.first_name,
  last_name: this.last_name,
  password: this.password,
   state: this.state


var that = this;

var loader = this.loadingCtrl.create({
content: “Please wait…”,


this.usersserviceProvider.signupUserService(account).then(authData => {

}, error => {

// Unable to log in
let toast = this.toastCtrl.create({
message: error,
duration: 3000,
position: ‘top’

  that.password = ""//empty the password field





it is not clear for me what the error cause, but in your code are a few bad habbits and serious timming problems.

Never use any as long it is not needed, use suitable types.
Never use var, as long it is not needed, use let.
In ionic 4 and I assume in ionic 3 it is similar, all (or maybe most) whatever.create(… or .present() returns a promise. Use await with async in function head or promise syntax .then(… In your code you have it on loader and toast that you call with .create and. present asyncrounous code, that never waits before it execute the next code.

Best regards, anna-liebt



i want do this…but problem in firebase email and password can get but first name, last name and etc dont get.

sorry this is first time im use…im still newbie…