I am using Webpack with firebase and firebase-admin.
To install firebase I ran
npm install --save firebase
I am importing firebase
I ran into this as well. My issue was the npm module @firebase was installed as well as the firebase module. When I required firebase in my JavaScript code with ‘require(“firebase”)’, webpack bundled @firebase instead for some reason.
@firebase doesn’t include auth, database etc. by default...it’s modular so you can require them separately. Consequently I received the above error when I tried calling auth().
To fix it you can remove @firebase...or just add the full path to the correct firebase when you require it like
require(‘/path/to/node_modules/firebase/firebase.js’)