Skip to content
Advertisement

React Firebase app auth service does not work in production

I have set up a React authorization through the Google account on my web app, that does not really work in production, however, works on the localhost. Here is the message from the dev mode (that perhaps may impact): The issue is that the google sign-in modal instantly disappears from the screen!

It looks like you're using the development build of the Firebase JS SDK.
When deploying Firebase apps to production, it is advisable to only import
the individual SDK components you intend to use.

import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';

What may be an error and the solution here? I use the real-time database to modify values (that actually properly work) and auth service for google accounts.

Advertisement

Answer

The error message you are getting is telling you how to fix the issue. The problem is the way you are importing the Firebase SDK. If you have something different as the below, I would recommend you to change it:

import firebase from 'firebase/app';
import 'firebase/storage';//if using Firebase storage, if not, set the right component.
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement