gax-nodejs icon indicating copy to clipboard operation
gax-nodejs copied to clipboard

Compiling Electron leads to firestore breaking due to grpc issues.

Open CreativeBuilds opened this issue 5 years ago • 4 comments

Hey there! I am currently developing a desktop application using electron that is able to run as an admin client for our managers at work. I've run into an issue with using firebase-admin where when electron is in dev mode it works fine, but when compiled into an exe format it breaks and the error it has is saying that I need to "pass auth instance to grpc-fallback-client" and its coming from new GrpcClient looking further into the code about how this is made its a google-gax client.

Not sure if this is the correct area to put this but I've tried other areas and found nothing. The only similar issue I have seen is #356

Environment details

  • OS: Windows
  • Node.js version: 8.16.1
  • npm version: 6.4.1
  • google-gax version: 1.3.0

Steps to reproduce

(very custom way to hit this and I don't really know how to walk someone through getting to this exact error)

  1. Have an Electron app that you can compile to exe
  2. inside the main.js or type script file add an admin client from firebase-admin
  3. Authenticate your admin client
  4. Try and pull a collection from firestore

Thanks!

CreativeBuilds avatar Aug 28 '19 17:08 CreativeBuilds

Hi @CreativeBuilds, we are actively working on making our libraries work in environments that cannot provide gRPC (including Electron). The error you're seeing, related to providing auth to the constructor, is a part of that work, stay tuned and the second part - the client libraries changes (Firebase and others) - will come shortly.

If waiting for maybe a month or so is not an option for you, you can consider making the server side Node.js application that would talk to Firebase, and talk to it from your Electron app, as a workaround.

alexander-fenster avatar Aug 29 '19 19:08 alexander-fenster

Sorry I wasn't very clear I am actually using the node application part of electron to use firebase-admin when compiled however, it doesn't allow for grpc access (but it still should be running an underlying node process)

I will wait for the update though that should fix this. Thanks for the help

CreativeBuilds avatar Sep 04 '19 18:09 CreativeBuilds

Hey there, I was wondering if any update has been made to this? @alexander-fenster said it would take around a month?

CreativeBuilds avatar Oct 03 '19 16:10 CreativeBuilds

@CreativeBuilds Yes, all the code is there, with the only small caveat: the documentation is not here yet :) Before I write more, can you share a little bit of your code that shows which client library are you using, and how do you create a client?

alexander-fenster avatar Oct 03 '19 17:10 alexander-fenster