I’ve been hitting walls with auth and Redwood all day long (auth0 and now firebase).
So after creating an app at Firebase and adding it as auth provider in Redwood app, I get this message in browser:
TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_2__.initializeApp is not a function
(anonymous function)
src/index.js:24
21 | }
22 |
23 | const firebaseClient = ((config) => {
> 24 | firebase.initializeApp(config)
25 | return firebase
26 | })(firebaseClientConfig)
27 |
I’ve been trying with different imports for firebase but with no luck. The contents in index.js is just as Redwood generated them. Anyone with any idea? Thanks
Hi @semirte, sorry to hear you’ve having problems with auth. How are you importing firebase, and what version are you using? Also, could you please provide the output of yarn rw info, thanks
@semirte this is likely to do with how you imported firebase. Sometimes NPM module publishers don’t (yet) support ES module imports, so you have to use the import * syntax.
Try this:
import * as firebase from 'firebase/app'
import 'firebase/auth'