googlearchive / generator-angularfire

Yeoman generator for AngularFire: Angular + Firebase apps
191 stars 52 forks source link

Firebase.child failed: Was called with 2 arguments. Expects no more than 1. #58

Open cjfagerstrom opened 8 years ago

cjfagerstrom commented 8 years ago

When you click the register button, you get an error that 2 arguments were called on firebase.child instead of 1.

When this would occur, the user would be created in Firebase and trying to reregister would generate an error that the email was already taken. Logging in with the credentials and viewing the profile page displays no email address and no username.

I changed Ref.child('users', user.uid) to Ref.child('users').child(user.id) in login.js under the createProfile(user) function and that fixed the issue.

cheenbabes commented 8 years ago

I think you mean Ref.child('users', user.uid) to Ref.child('users').child(users.Uid)

Nice catch, this solved it for me as well.

strickland84 commented 8 years ago

Neither of the above suggestions worked for me. However, this did:

var ref = Ref.child('users/' + user.uid)

bpkennedy commented 8 years ago

@strickland84 's solution worked for me also.

kevinpmbudd commented 8 years ago

Thanks for having this discussion here, helped me out alot. var ref = Ref.child('users').child(user.uid) worked for me.