0

import { initializeApp } from "firebase/ap";
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";

const firebaseConfig = {
  ***
};


const app = initializeApp(firebaseConfig);

const app = createApp(App);

app.use(router);
app.mount("#app");


So basically this is how you inialize firebase in vue


const app = initializeApp(firebaseConfig);

and below is how you initialize the vue app but am getting the erroe app is already is declared but not sure how to fix

Thomas
  • 2,431
  • 17
  • 22
patso
  • 11
  • 2
  • 2
    You declared two variables named `app`. Of course it throws an error on the second declaration. Read about [`const`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const). – axiac Feb 02 '23 at 11:48
  • Axiac is right but i want to add: do never post your credentials somewhere. I would consider them compromised now. – Thomas Feb 02 '23 at 13:59
  • 1
    @Thomas: in general that is true, and thanks for removing the values as they're not useful to the problem at had anyway. For Firebase though, you might want to read: https://stackoverflow.com/questions/37482366/is-it-safe-to-expose-firebase-apikey-to-the-public – Frank van Puffelen Feb 02 '23 at 14:18

0 Answers0