On the way to success
On the way to success

Reputation: 210

How do you integrate react-native-firebase for an expo’s bare workflow setup?

Do you know the correct way to integrate react-native-firebase to an expo app? Is it possible to implement react-native-firebase (NOT the web SDK) to an expo app in the first place? And now you might be thinking “Dude, why NOT web SDK?”

Well, I want to have authentication, push notification and also, distributing the app and testing it with users is absolutely essential. To do that what’s the best possible way? Asking users to install the expo go isn’t an option. From the firebase documentation, you can see that they have the app distribution option, which doesn’t ask the user to download anything. Isn’t it?

So, what have I done already? I’ve already implemented the module. But got dozen different errors. Tried different things; nothing worked though. Following error is the latest one:

\node_modules\@react-native-firebase\auth\lib\index.js:18
import {
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:1001:16)
    at Module._compile (internal/modules/cjs/loader.js:1049:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)

Do you know any solution for this issue with integrating firebase-react-native? Is there a work around which will yield the same results I mentioned above? What insights could you offer to this newbie?

THANKS A TON!!

Upvotes: 0

Views: 221

Answers (1)

Christer Loob
Christer Loob

Reputation: 161

I had a similar problem & I ended up ejecting from expo. It wasn't really that bad and I got it running just fine after that. Just keep an eye on your console when ejecting, you might receive a bunch of errors but the suggestions given in the console are immensely helpful.

Upvotes: 1

Related Questions