Firebase初心者です
ログイン画面に移行時にエラーがました
Server Error FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app). This error happened while gen
config.js
export const firebaseConfig = { apiKey: "AIzaSyAyuHhJhcsPUrmgmtdPXVKhiFQHYuxxxvY", authDomain: "next-9335f.firebaseapp.com", databaseURL: "https://next-9335f.firebaseio.com", projectId: "next-9335f", storageBucket: "next-9335f.appspot.com", messagingSenderId: "983587969965", appId: "1:983587969965:web:0e955e860a5465c7b9df24", measurementId: "G-CNJFE3SHB6" };
index.js
import firebase from "firebase/app" import "firebase/auth"; import "firebase/firestore"; import "firebase/functions"; import "firebase/storage"; import {firebaseConfig} from "./config"; firebase.initializeApp(firebaseConfig); export const auth = firebase.auth(); export const db = firebase.firestore(); export const functions = firebase.functions(); export const storage = firebase.storage(); export const fb = firebase; export const FirebaseFieldValue = firebase.firestore.FieldValue export const FirebaseTimestamp = firebase.firestore.Timestamp;
試したこと
キャッシュの削除
config.jsの変更 export const firebaseConfig = { apiKey: "**********", authDomain: "next-9335f.firebaseapp.com", databaseURL: "https://next-9335f.firebaseio.com", projectId: "next-9335f", storageBucket: "next-9335f.appspot.com", messagingSenderId: "983587969965", appId: "1:983587969965:web:0e955e860a5465c7b9df24", measurementId: "G-CNJFE3SHB6" }; エラー文 Failed to compile ./pages/firebase/index.js Attempted import error: 'firebaseConfig' is not exported from './config'.
開発環境
next.js React
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/08/28 21:33
2020/08/29 01:05
2020/08/29 02:16