Firebase 对身份验证无响应(signInWithEmailAndPassword)

问题描述 投票:0回答:1

我正在使用 Remix 框架并在名为 auth.server.js 的文件中的节点上初始化 firebase。 这段代码工作正常,但现在我已经升级到 Remix v2 并将 firebase 升级到 10.7.2。 当我现在运行时,它卡在signInWithEmailAndPassword 上,没有错误或失败。 只是变得没有反应。我几乎什么都试过了!!但没有解决。

如果我探测身份验证,我可以看到它可以访问配置,但在 errorFactory 错误中

错误:{ 'dependent-sdk-initialized-before-auth': '另一个 Firebase SDK 已初始化,并在初始化 Auth 之前尝试使用 Auth。 开始前请务必致电

initializeAuth
getAuth
任何其他 Firebase SDK。” }

  const firebaseConfig = {
  apiKey: "...",
  authDomain: "...",
  projectId: "...",
  storageBucket: "...",
  messagingSenderId: "...",
  appId: "..."
};
const app = firebase.initializeApp(firebaseConfig);

我的登录代码是

async function signIn(email, password) {
 
  const auth = getAuth(app);
  let result = null;
  
  try {
   result = await signInWithEmailAndPassword(auth, email, password);
  } catch (error) {
    console.log("error signin ", error);
    result = error
  }

  return result;
}
node.js firebase-authentication remix.run
1个回答
0
投票

这显然是最新 Remix 版本 2.5.1 的问题。这可能是一个错误。

我已经尝试使用不同的混音模板进行相同的操作https://github.com/remix-run/remix/tree/main/templates/unstable-vite并且它有效。

npx create-remix@latest --template remix-run/remix/templates/unstable-vite
© www.soinside.com 2019 - 2024. All rights reserved.