TypeError: firebase.initializeApp is not a function
at Object.
at __webpack_require__ (........./isomorphic-react-app/functions/build/server.bundle.js:21:30)
at Object.module.exports.module.exports.status (........../isomorphic-react-app/functions/build/server.bundle.js:22825:76)
at __webpack_require__ (........./isomorphic-react-app/functions/build/server.bundle.js:21:30)
at Object.module.exports.exports.__esModule (......./isomorphic-react-app/functions/build/server.bundle.js:40944:63)
at __webpack_require__ (......./isomorphic-react-app/functions/build/server.bundle.js:21:30)
at ......./isomorphic-react-app/functions/build/server.bundle.js:67:18
at Object.
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
+1 this appears for isomorphic-react-app when you do firebase serve --only hosting,functions
This seems to happen for me on the default (Node-8) branch, but not on master — it seems using an older version of the firebase package does the trick: 4.x works, 5.x does not.
Perhaps an automated process (@dpebot) upgraded things without testing?
This is still happening. Please provide a fix for this. It happens even wehn you try to deploy to firebase
I'm using Firebase 6.0.1, the ES import statement import firebase from 'firebase/app'; works for me,
but the one in the instruction import * as firebase from "firebase/app"; does not. Please update.
Just want to follow up on this as I'm having the exact same error in a gatsby app when using this with gatsby-plugin-layout. Following @tanbt 's solution fixes the issue, but gives plenty of warnings. I might look into this a bit later on.
I'm using Firebase 6.0.1, the ES import statement
import firebase from 'firebase/app';works for me,
but the one in the instructionimport * as firebase from "firebase/app";does not. Please update.
I'm using Firebase 6.0.1, the ES import statement
import firebase from 'firebase/app';works for me,
but the one in the instructionimport * as firebase from "firebase/app";does not. Please update.
Thanks! I was also stuck at this error. importing firebase without * works xD
Most helpful comment
I'm using Firebase 6.0.1, the ES import statement
import firebase from 'firebase/app';works for me,but the one in the instruction
import * as firebase from "firebase/app";does not. Please update.