Firebase: No Firebase App '[DEFAULT]' has been created Error


#1

Anyone has experience this error?

When I tried to login with firebase auth with email & password.

Firebase: No Firebase App ‘[DEFAULT]’ has been created - call Firebase App.initializeApp() (app/no-app).

FirebaseError
    E:\workspace\reactnative\auth-app-expo\node_modules\firebase\app\errors.js:37:30
create
    E:\workspace\reactnative\auth-app-expo\node_modules\firebase\app\errors.js:85:40
error
    E:\workspace\reactnative\auth-app-expo\node_modules\firebase\app\firebase_app.js:385:27
app
    E:\workspace\reactnative\auth-app-expo\node_modules\firebase\app\firebase_app.js:350:18
serviceNamespace
    E:\workspace\reactnative\auth-app-expo\node_modules\firebase\app\firebase_app.js:273:101
onButtonPress
    E:\workspace\reactnative\auth-app-expo\src\components\LoginForm.js:13:4
touchableHandlePress
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Components\Touchable\TouchableOpacity.js:127:45
_performSideEffectsForTransition
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Components\Touchable\Touchable.js:746:34
_receiveSignal
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Components\Touchable\Touchable.js:664:44
touchableHandleResponderRelease
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Components\Touchable\Touchable.js:433:24
invokeGuardedCallback
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\utils\ReactErrorUtils.js:22:15
invokeGuardedCallback
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\utils\ReactErrorUtils.js:110:39
invokeGuardedCallbackAndCatchFirstError
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\utils\ReactErrorUtils.js:133:62
executeDispatch
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\EventPluginUtils.js:92:4
executeDispatchesInOrder
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\EventPluginUtils.js:123:20
executeDispatchesAndRelease
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\EventPluginHub.js:37:46
executeDispatchesAndReleaseTopLevel
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\EventPluginHub.js:48:37
forEachAccumulated
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\utils\forEachAccumulated.js:30:16
processEventQueue
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\EventPluginHub.js:236:8
runEventQueueInBatch
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\ReactEventEmitterMixin.js:18:35
handleTopLevel
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\ReactEventEmitterMixin.js:38:25
<unknown>
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\native\ReactNativeEventEmitter.js:107:8
fiberBatchedUpdates
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\ReactGenericBatching.js:27:12
performFiberBatchedUpdates
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\ReactGenericBatching.js:33:29
perform
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\stack\reconciler\Transaction.js:152:24
batchedUpdates
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\stack\reconciler\ReactDefaultBatchingStrategy.js:61:33
batchedUpdates
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\stack\reconciler\ReactUpdates.js:92:41
batchedUpdates
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\ReactGenericBatching.js:38:29
batchedUpdatesWithControlledComponents
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\shared\event\ReactGenericBatching.js:51:26
_receiveRootNodeIDEvent
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\native\ReactNativeEventEmitter.js:105:40
receiveTouches
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\Renderer\src\renderers\native\ReactNativeEventEmitter.js:193:8
__callFunction
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:245:47
<unknown>
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:101:26
__guard
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:213:6
callFunctionReturnFlushedQueue
    E:\workspace\reactnative\auth-app-expo\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:100:17

#2

Hi welcome to Expo @vanbumi!

A couple of questions

Are you importing Firebase?
Have you called firebase.initializeApp?


#3

yes I have done this:

componetWillMount() {
const config = {
apiKey: “xxxxxxxxxxxxxxxxxxxxxxxx”,
authDomain: “auth-bdcdc.firebaseapp.com”,
databaseURL: “https://auth-bdcdc.firebaseio.com”,
projectId: “auth-bdcdc”,
storageBucket: “auth-bdcdc.appspot.com”,
messagingSenderId: “xxxxxxxxxx”
};
firebase.initializeApp(firebaseConfig);


#4

Change componetWillMount ==to==> componentWillMount

this is a little mistake :blush:


#5

Oww my… !!

typo

thanks sms1989, you save me :slight_smile:


#6

Thanks @sms1989 Great prompt! For whatever reason I was using componentDidMount so it was never going to happen …

I’m calling the firebase initialize app in my main App.js and then having a Loading Screen which is the initial route I’m then checking whether the user is signed in or not

    componentDidMount() {
        firebase.auth().onAuthStateChanged(function(user) {
            if (user) {
                console.log('User is signed in.');
            } else {
                // No user is signed in.
                console.log('No user is signed in.');
            }
        });
    }

Whether I should do this in saga or not, I’m not quite sure yet.

Thanks anyway!


closed #7

This topic was automatically closed after 14 days. New replies are no longer allowed.