Firebase analytics are not supported in this enviroment

Viewed 52

I'm using NextJs and Firebase and each time i build the app or run the dev server i get a warning in the terminal:

@firebase/analytics: Analytics: Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: (1) Cookies are not available. (analytics/invalid-analytics-context).

I do not know what that means i initialize my analytics on the frontend, as i do for all of my firebase services.

My Firebase.js file:

import { initializeApp } from "firebase/app";
import {getAnalytics} from "firebase/analytics";

//Dev
const firebaseConfig = {
apiKey: "key",
authDomain: "key",
projectId: "key",
storageBucket: "key",
messagingSenderId: "key",
appId: "key"
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics();
0 Answers
Related