New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firestore refusing to connect with errors on grpc #4557
Comments
UPDATE: I tried it on a Windows machine and got the same problem, I have deduced its either my Wifi, Firebase, or my init code for Firestore. Down below I will put my initialization code for the database. (this is copy-pasted with sensitive data redacted, it worked before and I haven't touched that code in ages so its not wrong config info) var firebase = require("firebase/app");
// Add the Firebase products that you want to use
require("firebase/auth");
require("firebase/firestore");
require("firebase/analytics");
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
var firebaseConfig = {
apiKey: "redacted",
authDomain: "redacted",
databaseURL: "redacted",
projectId: "redacted",
storageBucket: "redacted",
messagingSenderId: "redacted",
appId: "redacted",
measurementId: "redacted"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
var db = firebase.firestore(); |
The If that's the case, putting
or
anywhere in your code (without any Firebase) will get the same error, if you want to check quickly. |
@hsubox76 Yes, it does give mostly the same error, but I am not using jsdom in either Node.js package or a CDN import. I will list all the packages that I am using below if that helps. I checked the issue that you mentioned this thread in (#4552) and tried the solutions (except ones related to jest) and they all seem to not work. Packages Used"devDependencies": {
"electron": "^11.2.3"
},
"testEnvironment": "node",
"dependencies": {
"electron-store": "^7.0.2",
"firebase": "^8.2.9",
"grpc": "^1.24.5",
"node-mp3-player": "^1.0.3",
"on-change": "^2.2.3",
"play-sound": "^1.1.3",
"youtube-mp3-downloader": "^0.7.6",
"yt-search": "^2.7.3",
"ytdl-core": "^4.4.5"
} |
It sounds like the broad issue is that you're using a Node method (in grpc) in a non-Node or not-completely-Node environment somehow. It might have something to do with Electron, which certainly has an environment like that in at least one of its contexts. You mentioned the code is in a "Node app", is it a simple Interestingly when I run the code you provided, I only get an error from Analytics (because it's not supported in Node) and if I remove it, everything else is fine. I feel like this isn't a native Node environment, and as such you don't want to be using the Node bundle at all. If this code is in Electron, maybe try reading this (I wrote it for users that were having trouble with Firebase and Electron): |
@hsubox76 I am currently running ALL Firebase-related code inside About the analytics error, I do have it commented out but for some reason, it didn't copy over into GitHub. I will try the article you sent and update it if it doesn't work or has new errors. |
I'm not familiar with command-line use of Electron but I know Electron has some unusual Node-like environments that aren't 100% compatible with Node. In general Electron seems to have some issues with that |
Just to try something, I upgraded Electron (using If anyone looking at this thread in the future needs more information on running Firebase in the |
Hey @kidsonfilms-python-rules and @hsubox76 , this is a real error in grpc-js! It was introduced in grpc-js v1.2.7 here: grpc/grpc-node#1688 And it is fixed with this PR: grpc/grpc-node#1709 Please reopen this issue and include the fixed version (as soon as released) into the next firebase release :) |
Hi @nicograef , |
Thanks for the update. See: #4552 (comment)
|
Cool, thanks! :) |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Whenever I try to get documents (any method) it gives the following error twice:
and then it gives the following error 10 seconds after trying to get the document:
I have tried to reset our Wifi Network, tried on different days in case it's Firebase's server fault.
Steps to reproduce:
index.js
Relevant Code:
The text was updated successfully, but these errors were encountered: