Skip to content

The user's commit modifies lib/firebase.ts to:#311

Draft
rodneyg wants to merge 1 commit intomainfrom
fix/analytics-init-debug
Draft

The user's commit modifies lib/firebase.ts to:#311
rodneyg wants to merge 1 commit intomainfrom
fix/analytics-init-debug

Conversation

@rodneyg
Copy link
Copy Markdown
Owner

@rodneyg rodneyg commented Jun 11, 2025

  • Rename the imported Analytics type to FirebaseAnalytics for clarity.
  • Add detailed console logs before and after key operations within the getAnalyticsInstance function.
  • Implement a specific check to ensure the getAnalytics function (imported from 'firebase/analytics') is actually a function and available before it's called. If not, it logs extensive debug information and throws an error. This is intended to help diagnose a "ReferenceError: Cannot access 'G' before initialization" that is suspected to be related to getAnalytics.
  • Improve error logging in the catch block of getAnalyticsInstance to capture more details if analytics initialization fails.

These changes are intended to provide more diagnostic information to understand and resolve the analytics-related initialization error.

- Rename the imported Analytics type to FirebaseAnalytics for clarity.
- Add detailed console logs before and after key operations within the `getAnalyticsInstance` function.
- Implement a specific check to ensure the `getAnalytics` function (imported from 'firebase/analytics') is actually a function and available before it's called. If not, it logs extensive debug information and throws an error. This is intended to help diagnose a "ReferenceError: Cannot access 'G' before initialization" that is suspected to be related to `getAnalytics`.
- Improve error logging in the catch block of `getAnalyticsInstance` to capture more details if analytics initialization fails.

These changes are intended to provide more diagnostic information to understand and resolve the analytics-related initialization error.
@vercel
Copy link
Copy Markdown

vercel bot commented Jun 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
safe-dose ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2025 5:35am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant