Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

projectId error #4

Open
Devansh-Mehra opened this issue Oct 12, 2023 · 0 comments
Open

projectId error #4

Devansh-Mehra opened this issue Oct 12, 2023 · 0 comments

Comments

@Devansh-Mehra
Copy link

Error - Uncaught FirebaseError: Installations: Missing App configuration value: "projectId" (installations/missing-app-config-values).
at getMissingValueError (extract-app-config.ts:54:24)
at extractAppConfig (extract-app-config.ts:41:13)
at Component.publicFactory [as instanceFactory] (config.ts:38:21)
at Provider.getOrInitializeService (provider.ts:318:33)
at Provider.getImmediate (provider.ts:115:21)
at Component.internalFactory [as instanceFactory] (config.ts:55:63)
at Provider.getOrInitializeService (provider.ts:318:33)
at Provider.getImmediate (provider.ts:115:21)
at Component.instanceFactory (index.ts:55:12)
at Provider.getOrInitializeService (provider.ts:318:33)
getMissingValueError @ extract-app-config.ts:54
extractAppConfig @ extract-app-config.ts:41
publicFactory @ config.ts:38
getOrInitializeService @ provider.ts:318
getImmediate @ provider.ts:115
internalFactory @ config.ts:55
getOrInitializeService @ provider.ts:318
getImmediate @ provider.ts:115
(anonymous) @ index.ts:55
getOrInitializeService @ provider.ts:318
initialize @ provider.ts:242
initializeAnalytics @ api.ts:112
getAnalytics @ api.ts:85
(anonymous) @ firebase.jsx:23

Codes -

// Import the functions you need from the SDKs you need
import { initializeApp } from 'firebase/app';
import { getAnalytics } from 'firebase/analytics';
import { getAuth } from 'firebase/auth';

// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries

// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: import.meta.env.VITE_REACT_APP_FIREBASE_API_KEY,
authDomain: import.meta.env.VITE_REACT_APP_FIREBASE_AUTH_DOMAIN,
projectId: import.meta.env.VITE_REACT_APP_FIREBASE_PROJECT_ID,
storageBucket: import.meta.env.VITE_REACT_APP_FIREBASE_STORAGE_BUCKET,
messagingSenderId: import.meta.env.VITE_REACT_APP_FIREBASE_MESSAGING_SENDER,
appId: import.meta.env.VITE_REACT_APP_FIREBASE_APP_ID,
measurementId: import.meta.env.VITE_REACT_APP_FIREBASE_MEASUREMENT_ID,
};

// Initialize Firebase
export const app = initializeApp(firebaseConfig);
export const analytics = getAnalytics(app);
export const auth = getAuth(app);

##using Vite instead of React

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

No branches or pull requests

1 participant