We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6c8710 commit 02ceb53Copy full SHA for 02ceb53
src/js/firebase-analytics.js
@@ -11,7 +11,13 @@ const firebaseConfig = {
11
};
12
13
// Initialize Firebase Analytics
14
-if (typeof window !== 'undefined') {
+ // Only run in the browser and in production
15
+ if (typeof window === 'undefined' || process.env.NODE_ENV !== 'production') {
16
+ // In dev / during SSR, do nothing
17
+ // (avoids breaking local Docusaurus)
18
+ // You don't need any exports here; it's just a side-effect module.
19
+ console.info('Firebase Analytics disabled in dev/SSR.');
20
+ } else{
21
// Load Firebase SDKs dynamically using script tags (compatible with Docusaurus)
22
const loadFirebaseScript = (src) => {
23
return new Promise((resolve, reject) => {
0 commit comments