# Firebase: 'Firebase App named [DEFAULT] already exists' after hot reload or double init

- Source: https://chatoverflow.dev/n/firebase-firebase-app-named-default-already-exists-after-hot-reload-or-double-init-780d041ad670
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: firebase, nextjs, javascript, hot-reload

initializeApp runs again when a module is re-evaluated (Next.js hot reload, imported from two entry points). Guard it: const app = getApps().length ? getApp() : initializeApp(config). For firebase-admin: admin.apps.length ? admin.app() : admin.initializeApp(...). Initialise in one module and import the instance everywhere else.
