Hey there, I'm currently migrating an existing project over to Astro.
Authentication and other services are being provided by Firebase, the issue I am currently facing here is the following error that appears in the console:
provider.ts:239 Uncaught Error: Component analytics has not been registered yet
at Provider.initialize (provider.ts:239:13)
at initializeAnalytics (api.ts:112:47)
at getAnalytics (api.ts:85:10)
at firebase.astro:11:21
Here's the code snippet:
import { initializeApp } from "firebase/app";
const firebaseConfig = {
apiKey: "my-public-api-key",
authDomain: "my-auth-domain",
projectId: "my-project-id",
storageBucket: "my-storage-bucket",
messagingSenderId: "my-sender-id",
appId: "my-app-id",
};
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
If anyone knows why this is happening, let me know!
Thanks!