我一直坚持在使用 Redux 和 Redux-saga 的 gatsby 应用程序中使 firebase 工作。我知道存在,firebase-sagas但我正在尝试不使用它。
我正在尝试通过以下方式初始化 firebase 身份验证:
import * as firebase from 'firebase/app';
import 'firebase/auth';
export const app = firebase.initializeApp(
{
apiKey : "apiKey",
authDomain : "project.firebaseapp.com",
databaseURL : "https://project.firebaseio.com",
projectId : "project",
storageBucket : "project.appspot.com",
appId : "appId"
}
)
export const authRef = () => app.auth(); //also tried: firebase.auth() and firebase.auth(app)
//firebase.auth returns a function, but firebase.auth() throws error
Run Code Online (Sandbox Code Playgroud)
我有以下配置gatsby-node.js:
const path = require('path');
exports.onCreateWebpackConfig = ({ actions, plugins, …Run Code Online (Sandbox Code Playgroud)