简体   繁体   English

使用Firebase注册电子邮件/密码时出现“网络错误”错误

[英]“A network error has occurred” error on email/password sign up with Firebase

I'm following the setup for email/password sign up that Firebase has specified in their official documentation; 我正在按照Firebase在其官方文档中指定的电子邮件/密码注册设置进行操作; however, I keep getting "a network error has occurred" error when proceeding with authentication. 但是,在继续进行身份验证时,我一直收到“发生网络错误”错误。

Authentication code: 验证码:

window.onload = function() {
  const config = {
        apiKey: "",
    authDomain: "",
    databaseURL: "",
    storageBucket: "",
    messagingSenderId: ""
  };
  firebase.initializeApp(config);
  const btnSignUp = document.getElementById('btnSignUp');

  btnSignUp.addEventListener('click', function() {
    const inputEmail = document.getElementById('username-input');
    const inputPassword = document.getElementById('password-input');

    const email = inputEmail.value;
    const password = inputPassword.value;
    firebase.auth().createUserWithEmailAndPassword(email,    password).catch(function(error) {
        console.log(error);
    });
  });
};

Console errors: 控制台错误:

A network error (such as timeout, interrupted connection or unreachable host) has occurred.

All set - the problem was the 'type' attribute in the button was not defined and was defaulted to a submit type. 全部设置-问题是按钮中的'type'属性未定义,并且默认为提交类型。 By setting type="button", the issue was resolved. 通过设置type =“ button”,此问题已解决。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 react-firebase-hook sign in with email and password error massage 问题 - react-firebase-hook sign in with email and password error massage problem 密码注册后 Firebase 云函数未经身份验证的错误 - Firebase Cloud Function Unauthenticated Error After Password Sign-Up Firebase 身份验证:错误:发生网络错误(例如超时、连接中断或主机无法访问) - Firebase Auth : Error: A network error (such as timeout, interrupted connection or unreachable host) has occurred Android - cordova - 发生网络错误 - Android - cordova - A network error has occurred 频繁出现“发生网络错误(例如超时、连接中断或主机无法访问)”。 使用 Firebase - Frequent "A network error (such as timeout, interrupted connection or unreachable host) has occurred." with Firebase Web中的Firebase:发生了网络错误(例如超时,中断连接或无法访问的主机)? - Firebase in Web : A network error (such as timeout, interrupted connection or unreachable host) has occurred? Firebase '发生网络错误(例如超时、连接中断或主机无法访问)。 - Firebase 'A network error (such as timeout, interrupted connection or unreachable host) has occurred.' Firebase使用电子邮件登录失败,但未提供错误 - Firebase Sign In With Email fails without providing an error firebase SERVER_ERROR的电子邮件/密码身份验证 - email/password authentication for firebase SERVER_ERROR Firebase密码和电子邮件身份验证失败,并显示错误 - Firebase password and email authentification fails with error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM