question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firebase npm module incompability with new 0.37

See original GitHub issue

Description

Until version 0.36 React native was compatible with Firebase javascript library. https://www.npmjs.com/package/firebase

When you register a user, Firebase basically persists this information for you. Now on version 0.37, this information is not available any more. Thus, the user has to login every time that he opens the application.

There is no release notes that could justify this behavior. It seems to me that this is undesirable side effect.

Reproduction

Add firebase 3.6.0 on your package.json. Do any simple firebase example.

var firebase = require('firebase/app');
require('firebase/auth');
require('firebase/database');
 
var app = firebase.initializeApp({ ... });
this.FirebaseAuth = this.FirebaseApp.auth();
this.FirebaseAuth.signInWithEmailAndPassword('email@email.com', '12345678')
// ...

then open and close your application try to

var firebase = require('firebase/app');
require('firebase/auth');
require('firebase/database');
 
var app = firebase.initializeApp({ ... });
this.FirebaseAuth = this.FirebaseApp.auth();
this.FirebaseAuth.currentUser

The current user gonna be null.

Solution

No idea.

Additional Information

This situation is not happening when using version 0.36 I couldn’t figure out, based on release notes what affect the firebase behavior. It affects only iOS.

  • React Native version: 0.37
  • Platform: iOS.
  • Operating System: MacOS.
  • Packages:
      "firebase": "^3.6.0",
      "react": "15.3.2",
      "react-native": "0.37.0",
      "react-native-datepicker": "^1.4.2",
      "react-native-fbsdk": "^0.3.0",
      "react-native-fcm": "^2.3.2",
      "react-native-fetch-blob": "^0.10.0",
      "react-native-google-signin": "^0.8.1",
      "react-native-i18n": "^0.1.1",
      "react-native-image-picker": "^0.23.0",
      "react-native-keyboard-spacer": "^0.3.0",
      "react-native-swipe-list-view": "^0.3.1"
    

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
channing-googlecommented, Nov 19, 2016

Hello, I’m from the Firebase team. Firebase checks if navigator.product==“ReactNative” to execute some RN-specific code. It seems that 0.37.0 changed navigator.product to be “Gecko” (at least on my machine), so Firebase thinks it’s in a web browser environment.

0reactions
starovoitovscommented, Dec 22, 2016

Downgrading to 0.36.0 fixed the issue for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase JavaScript SDK Release Notes - Google
Updated firebase/[product] entry point bundles to conform to Node.js ES module ... The new package is API compatible but has the following breaking...
Read more >
firebase - npm
Firebase provides the tools and infrastructure you need to develop, grow, and earn money from your app. This package supports web (browser), ...
Read more >
firebase - npm
Firebase JavaScript library for web and Node.js. Latest version: 9.15.0, last published: 20 days ago. Start using firebase in your project ...
Read more >
@firebase/app - npm
The primary entrypoint to the Firebase JS SDK. Latest version: 0.9.0, last published: 18 days ago. Start using @firebase/app in your project ...
Read more >
firebase - npm
Latest version: 9.10.0, last published: 12 days ago. ... The Firebase JavaScript npm package contains code that can be run in the browser ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found