Firebase modular (v9) incompatible with Expo - firebase

I'm using Expo v42.0.1 and trying to install Firebase v9.0.2 and am unable to do so.
Issue
From running expo install firebase, firebase version 8.2.3 is installed. When changing the package.json to use firebase version 9.0.2, I get an error when running the app:
"firebase" is added as a dependency in your project's package.json but it doesn't seem to be installed. Please run "yarn" or "npm install" to fix this issue.
What I've tried
Running yarn / npm install
Running expo install firebase#9.0.2 (which ends up just downloading 8.2.3)
Has anyone seen this before or know why it is happening? I believe it is because Expo v42 is not yet compatible with the modular version of firebase (v9).

You are correct.
Has anyone seen this before or know why it is happening? I believe it is because Expo v42 is not yet compatible with the modular version of firebase (v9).
But you can make it work with using it like this in you package.json:
"#firebase": "^9.0.2",
Discussion about this: "firebase" is added as a dependency in your project's package.json but it doesn't seem to be installed
I have used this solution in 2 projects. 1 works perfectly but in another I faced issued where version firebase#9.0.0-beta.7 works perfectly but in version firebase#9.0.2 everything but Firestore works
More about it here: Expo + firebase#9.0.1/9.0.0: #firebase/firestore:, Firestore (9.0.0): Could not reach Cloud Firestore backend

Related

Firebase Next.js Hosting: Unable to find 'esbuild'

I'm trying to use Firebase's new Next.js support for Hosting (see https://firebase.google.com/docs/hosting/nextjs) but I'm getting a weird error when I try to deploy. (Everything runs correctly in the local emulator suite, btw)
Screenshot of Console output with error
When I try to run firebase deploy --only hosting,functions -m "testing out next.js support" I'm getting the error Unable to find 'esbuild'. Install it into your local dev dependencies with 'npm i --save-dev esbuild''. I've already added esbuild to my dev dependencies, and it seems to be installed correctly. My project uses yarn, not npm, but for the sake of testing I tried install it with npm like the error suggested, but that didn't work either.
Has anyone used Firebase Next.js hosting or figured it out since they've released it? The documentation on that page I linked above is... not great.
Make sure that you are using the latest Firebase Tools as per the documentation: "Firebase CLI version 11.14.2 or later".
Run npm install -g firebase-tools to update your version.

How to set up Vue 3 Firebase project on MacOS

I am attempting to set up a VueJS Authentication app using Vue 3 and Firebase on my Mac Mini and Macbook. I have gone through the steps to add Firebase to my VueCLI project, by inputting npm install firebase in the terminal after cd-ing to the project. after running npm install firebase, Firebase appears as a dependency in package.json. However, after importing firebase and adding the firebaseConfig (from my firebase dashboard) to main.js, as well as importing firebase into App.vue, I get an error in the terminal saying:
This dependency was not found:
* firebase in ./src/main.js
To install it, you can run: npm install --save firebase
This appears to happen only when attempting to run a Vue/Firebase project on MacOS. What is the proper way to install Firebase on a VueCLI project when running that project on MacOS? Thanks.

React Native Firebase only works on iOS

I'm fairly new to React Native so I've been following the "The Complete React Native and Redux Course" by Stephen Grider. On section 9, lecture 59 he installs Firebase using npm with "npm install --save firebase", and so did I, however this only works for iOS for me. Whenever I run the app on an Android simulator I get this error saying Objects are not valid as a React child.
Screenshot
Edit: I'll try to explain this problem better as per advice from akraf. The only thing I need to do to recreate this Error is create a React Native project. Then install Firebase through npm to the project directory. Once I add the line "import firebase from 'firebase';" to the App.js file, the error occurs. Nothing else, just the import causes the error.
Try to install the version 5.0.2. Use this command as administrator:
npm install --save firebase#5.0.2
As far as i see, the current version (5.0.4) is buggy!

Firestore is failed to build with Flutter for iOS

I want to add Firestore to Flutter app, and I have problems running it on iOS.
I already added this line to pubspec.yaml
cloud_firestore: ^0.6.3
Flutter is updated. Flutter doctor says that I have v0.3.1.
While compiling app for iOS simulator I got this build error
Xcode's output: ↳ /
Users/*********/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.3/ios/Classes/FirebaseCorePlugin.m:7:9:
fatal error: 'Firebase/Firebase.h' file not found
#import <Firebase/Firebase.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated
I also run pod update to make sure that it is not issue with cocoapods.
UPDATE
After another research I found that deleting #use_frameworks! from Podfile in iOS folder let's project to compile. But what should be done in case when this can't be deleted?
The update to this gives me enough information to diagnose (hopefully). Flutter wasn't very good at supporting #use_frameworks & swift, but that was fixed fairly recently (mid-april 2018). However, it may not have made it to the beta channel yet at time of writing.
What was going on when #use_frameworks was set previously is that it wasn't linking everything into the right libraries, and a cocoapods bug was stopping it from finding certain files. The newest version of everything uses dynamic linking but has static_framework=true in the podfile for dependencies with static dependencies so that everything they need actually get linked into the right place.
This is fixed & tested on the master branch/channel, but should probably have made it to the dev branch/channel by now.
Here's the steps to makes sure your environment will support the fix, from this other github issue:
make sure you have Cocoapods 1.5.0 installed (pod --version should
say >= 1.5.0)
change any dependencies you have on the firebase_xxx, google_sign_in, or cloud_firestore plugins to the newest versions
(look for changelog entries referring to Cocoapods 1.5.0)
change your ios/Podfile to the newest version on Flutter master branch
(https://github.com/flutter/flutter/tree/master/packages/flutter_tools/templates/cocoapods)
delete ios/Podfile.lock and ios/Pods
switch to Flutter master (or dev) branch using flutter channel <branch>
flutter clean ; flutter run

Cloud Functions for Firebase - functions.database.instance (and InstanceBuilder) not found

I'm trying to add listeners in my cloud functions to a second database instance according to the documentation here using:
exports.myHandler = functions.database.instance('foo').ref('bar')...
I am getting an error that the functions.database.instance() function doesn't exist. I have updated my functions using npm upgrade and firebase-functions specifically using npm install --save firebase-functions. I still don't see any reference to InstanceBuilder or functions.database.instance() in the source code. Has this functionality actually been released? Am I missing something?
I updated the dependencies in package.json to use the latest versions of firebase-admin and firebase-functions, and it's fixed.

Resources