0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

「Firebase App named '[DEFAULT]' already exists」のエラーが解決できない!?

Posted at

チームで開発している際、度々タイトルのエラーに悩まされました、、。
Firebaseは認証とストレージを利用していました。この問題が起こるタイミングが決まってリポジトリを作り直した際でした。
ネットでの解決策を見てみると決まって、「firebase.initializeAppが複数回呼ばれているため一度だけ呼び出すようにする」という答えでした。
私たちも他の記事の方と同様に以下のコードを追加しましたが解決できません、、。

if (firebase.apps.length === 0) {
  firebase.initializeApp(firebaseConfig);
}

しかし、そもそも私たちがこのエラーに悩まされている時はリポジトリを作り替えて.envに保存した時ということと時間と共になぜか解決するということがわかっていたので、まさかとは思いましたが、
nextディレクトリのcacheディレクトリを削除することで解決しました!!
どうやらキャッシュが残っていたことが原因のようでした、、。

皆さんもなぜか同じ問題が解決できないというときは試してみてください!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?