Open shirlev-wix opened 4 years ago
Thanks for the report, @shirlev-wix. While I'm trying to replicate this, can you try using the latest version (7.8.2)? Most of these reports tend to be network related. If you can get network logs, that would be very helpful.
@shirlev-wix I'm trying to reproduce this issue but haven't been able to. Putting your working repro up on StackBlitz would be very helpful as we could fork it and might help you get it running. Thanks!
Hey @shirlev-wix. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Hi, Upgrading firebase didn't help. I created a small react native app to reproduce the bug. https://github.com/shirlev-wix/firebase-bug
When debugging you can see the UI stays not connected.
Hi @rommelpe! Any updates regarding this one? It is really making our life harder when trying to debug things related to firebase.
same issue --
code: "auth/network-request-failed", message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred."
"firebase": "^7.13.2",
"react": "16.9.0",
"react-native": "0.61.5",
Not sure is the same, but I get a an error saying I have no connection on my device on an Android Emulator, but making requests with i.e. unfetch library, work just fine.
edit: In my case it happens with await Firestore.collection('users').get()
Our users experience the same auth/network-request-failed
firebase auth issues since some time now. It mainly happens to Android Chrome users and the issue start immediately after/during using firebase.auth().signInAnonymously
. (Note: I'm not using react, I simply use plain old Node.js SSR with vanilla js)
I'm also having a hard time reproducing the issue, I tried many real devices as well as devices on Browserstack. I'm just not getting this issue.
I already made sure that
form
html tag used<button type='button'>Signup</button>
elementAny ideas or any idea how I could reproduce it myself? Thanks a lot!
I'm receiving the same issue with React. I was testing logging in and it was returning a user object. 10 or so times later, it just stopped working and I have got the message Error: A network error (such as timeout, interrupted connection or unreachable host) has occurred.
for the past 12 hours.
Possible ways to resolve? Is this possibly a limit issue? Should I delete node_modules and do a fresh install of the the npm packages? Should I downgrade the firebase library?
"firebase": "^7.15.1",
"react": "^16.13.1",
"redux": "^4.0.5",
"redux-persist": "^6.0.0",
"redux-saga": "^1.1.3",
"redux-saga-firebase": "^0.15.0"
I'm facing the same error when trying to use google/facebook signing with popup, used to work before and nothing change in the code.
//version
"firebase": "^7.15.5"
let provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithPopup(provider).then(e => ...)
Im facing the same error using google to sign in with signInWithPopup. Works for some users just fine but fails for other users. //version "firebase": "^7.15.5"
I am running into the same error using google to sign in to my web app build with next js and deployed on vercel. Both on local, development and production.
"firebase": "^7.14.2",
Please advice
Folks-
Thanks for reporting this, does anyone have a trace for the endpoint and underlying error (like in https://github.com/firebase/firebase-js-sdk/issues/3081#issuecomment-631589480)? The Network Error you are seeing is a generic error we throw when the underlying fetch() call fails.
In my case with signInWithPopup the pop up url (app-name/__/auth/...) was unreachable and no redirect to facebook/google happens, it worked again days later without changing anything.
Hey @shirlev-wix. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
What kind of information do you need? Like I wrote on March 6, here's a demo project that reproduce the bug: https://github.com/shirlev-wix/firebase-bug
I'm having the same issue with a React Native Expo app. All of the sudden I cant make any development and I'm stuck with this unexpected error.
@obrunopolo , I faced with network problems on Android working with Expo too. I don't have a permanent solution, though two things work for me while developing:
I hope this will help you for development and there will be a fix from Firebase team soon.
I had the same Error. I solved it by Turning on the my phones internet connection by connecting to wifi.
Solution Turn on your phone's internet connection.
@Georgemburu that is not a "solution". Do you believe someone would come to GitHub and comment on this Issue just because the internet connection isn't on? I had this issue on a specific private wifi connection, all apps were working fine, except mine.
So I was having a similar issue where I was getting [Error: [auth/network-request-failed] A network error has occurred, please try again.]
on and IOS phone whenever I tried to auth().signInWithPhoneNumber(phoneNumber)
And the reason for that was because the Date and Time on the phone was wrong 🤷🏻♂️
Hi all, this issue is being tracked internally at b/171738114. It's on our radar to investigate, but unfortunately we don't have a timeline for this right now.
I am getting the same error, while using google-auth in react, on chrome browser. The authentication was working fine just yesterday. I am using a button to call the authentication function.
<button id="login">LOG IN</button>
It's November 2020, firebase login was working fine until yesterday, but now it does not work anymore.
It always throws auth/network-request-failed
error 👎
@google-oss-bot @shirlev-wix @Georgemburu
Any updates on this? some of my users started facing this issue, and are stuck out of app.
In my case with signInWithPopup the pop up url (app-name/__/auth/...) was unreachable and no redirect to facebook/google happens, it worked again days later without changing anything.
We are also facing this issue. On one particular occasion, we tried to debug the cause for 4 hours and then it was back to working. Another in most of the cases, changing the network connection (from broadband to mobile hotspot) helped get around this issue.
Recently I faced this issue twice on consecutive Mondays.
@Georgemburu that is not a "solution". Do you believe someone would come to GitHub and comment on this Issue just because the internet connection isn't on? I had this issue on a specific private wifi connection, all apps were working fine, except mine.
@obrunopolo Yes I agree this is not the issue. Although this is mostly not an issue related to network and firebase should get some help if changing networks solves this issue. I have also switched between 2 working connection, but it works on one network and fails on another.
Same error/issue. Suddenly. Did not change anything. It was working a while back perfectly. Pasting my error in the log which I'm getting from the code
firebase.auth().signInWithPopup(provider).then(function (result) {
...
}).catch(function (error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// The email of the user's account used.
var email = error.email;
// The firebase.auth.AuthCredential type that was used.
var credential = error.credential;
console.log(error); //This it the error being consoled.
});
The error in console:
_> u {code: "auth/network-request-failed", message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred.", a: null}
a: null code: "auth/network-request-failed" message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred." proto: Error constructor: ƒ u(a, b, c) Za: constructor: ƒ Error() message: "" name: "Error" toString: ƒ toString() proto: Object arguments: (...) caller: (...) length: 3 name: "u" prototype: Error {constructor: ƒ, v: ƒ, toJSON: ƒ} proto: ƒ ()
toJSON: ƒ d() v: ƒ () proto: Object_
Please help. Is there nay development on this issue? The error is coming in production. Users are not able to login. Please help. Thank you so much in advance.
Same error/issue. Suddenly. Did not change anything. It was working a while back perfectly. Pasting my error in the log which I'm getting from the code
firebase.auth().signInWithPopup(provider).then(function (result) { ... }).catch(function (error) { // Handle Errors here. var errorCode = error.code; var errorMessage = error.message; // The email of the user's account used. var email = error.email; // The firebase.auth.AuthCredential type that was used. var credential = error.credential; console.log(error); //This it the error being consoled. });
The error in console:
_> u {code: "auth/network-request-failed", message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred.", a: null}
a: null code: "auth/network-request-failed" message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred." proto: Error constructor: ƒ u(a, b, c) Za: constructor: ƒ Error() message: "" name: "Error" toString: ƒ toString() proto: Object arguments: (...) caller: (...) length: 3 name: "u" prototype: Error {constructor: ƒ, v: ƒ, toJSON: ƒ} proto: ƒ ()
toJSON: ƒ d() v: ƒ () proto: Object_
Please help. Is there nay development on this issue? The error is coming in production. Users are not able to login. Please help. Thank you so much in advance.
Please check if changing network solves this issue. I am also facing this issue with firebase-js-sdk.. It is very bad experience
Same error/issue. Suddenly. Did not change anything. It was working a while back perfectly. Pasting my error in the log which I'm getting from the code
firebase.auth().signInWithPopup(provider).then(function (result) { ... }).catch(function (error) { // Handle Errors here. var errorCode = error.code; var errorMessage = error.message; // The email of the user's account used. var email = error.email; // The firebase.auth.AuthCredential type that was used. var credential = error.credential; console.log(error); //This it the error being consoled. });
The error in console:
_> u {code: "auth/network-request-failed", message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred.", a: null}
a: null code: "auth/network-request-failed" message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred." proto: Error constructor: ƒ u(a, b, c) Za: constructor: ƒ Error() message: "" name: "Error" toString: ƒ toString() proto: Object arguments: (...) caller: (...) length: 3 name: "u" prototype: Error {constructor: ƒ, v: ƒ, toJSON: ƒ} proto: ƒ ()
toJSON: ƒ d() v: ƒ () proto: Object_
Please help. Is there nay development on this issue? The error is coming in production. Users are not able to login. Please help. Thank you so much in advance.
It somehow just started working back again. No errors or issue anymore. Pretty sure it's some issue deep in the firebase-JS sdk since many people faced it the same way.
I am also facing the same issue, and this is how it is happening to me. Mine is a react native app using expo. Firebase login is working fine in both expo and standalone app from my home network. But I sent apk file to my few friends, and one friend said he is getting this error (Error: A network error (such as timeout, interrupted connection or unreachable host) has occurred). He tried on multiple android phones (Pixel 4 and One plus nord). When he came to my home I tried to login from his phone and it worked. So now the firebase auth is working in my home network but not from my friend's.
Some of my users getting this issue in angular version 10. Does some known workaround exist? Downgrade the firebase to some version?
"@angular/core": "~10.2.0", "firebase": "8.0.2",
Hey guys, I was having the same issue in an AngularJS app. In this comment: https://github.com/firebase/firebase-js-sdk/issues/20#issuecomment-313236458 It is explained that Firebase checks for navigator.online before doing the auth process, and sometimes (and in some cases, always) it receives a wrong answer. By adding the cordova-plugin-network-information to the project, it provides the correct answer to Firebase and the app works again. In my case, I tried with version 2.0.2 of the plugin without success, and then with version 1.2.1 and, my app started to work fine.
Also having this issue using Expo, can't connect through Specific Wifi, connected 3 clients that are connected to the same WiFi,1 client works and 2 doesn't work, using Expo SDK 39. Any Updates?
I'm facing the same issue! Any update or workarounds please?
In my case the issue was resolved by changing the authDomain
to {{APP_ID}}.firebaseapp.com instead of {{APP_ID}}.web.app
Seeing the same issue here on firebase@8.2.6
.
authDomain
is {{APP_ID}}.firebaseapp.comnavigator.onLine
is true
Button is not inside a <form>
element. I also tried just attaching a function to window
, completely removing a button from the equation - no dice:
import firebase from 'firebase/app';
import 'firebase/auth';
import 'firebase/firestore';
import { firebaseConfig } from './config';
firebase.initializeApp(firebaseConfig);
export const auth = firebase.auth();
auth.onAuthStateChanged((user) => {
console.log('firebase user:', user);
});
const GoogleProvider = new firebase.auth.GoogleAuthProvider();
export const logInWithGoogle = () => {
auth.signInWithPopup(GoogleProvider)
.then((result) => {
console.log('LOGGED IN!!! User:', result.user);
})
.catch((error) => {
console.log('LOGIN ERROR!! :(', error);
});
};
export const logInWithEmail = (email, password) => {
auth.signInWithEmailAndPassword(email, password)
.then((user) => {
console.log('User signed in via email:', user);
})
.catch((error) => {
console.log('error signing in with email:', error);
});
};
// Invoking this results in the same `auth/network-request-failed` error
window.testLogin = logInWithGoogle;
Was planning to switch from AWS for a small project but looks like this issue's been around for almost a year now. Got stoked at how easy things are supposed to be to set up, and immediately ran into this!! 😬 😞
Well we were having the same issue on our website. Turns out for us the problem was that we switched hosting from firebase to vercel. And the route that was loading the pop up "_example.com/_auth/apiKey?... " was not free anymore. Chrome was not showing anything but firefox was showing our 404 page. So, we figured it was a DNS issue. We got it to working by switching to the default auth domain. We are now working on configuring a custom auth sub domain for our site. I will post an update if we figure that out
I was facing the same issue. It turned out that I was caching everything on my service worker js file. So I disabled these domains.
if ( url.origin === "https://securetoken.googleapis.com" || url.origin === "https://apis.google.com" || url.origin === "https://www.googleapis.com" ) { return; }
Our react app is suddenly this issue. Already disabled service workers. Also verified the Sign in with Google button is not in a form.
Running into the same issue. Have tried everything said here, except for switching to a different product :(
It looks like we're rocking on the same boat. I had createUserWithEmailAndPassword working well for a few hours on my Ionic App, running on Angular, and using AngularFireAuth.
What surprises me is that invoking AngularFireAuth's sendPasswordResetEmail works well without resulting in this troubling authError.
These are the versions of the Angular, Ionic, and firebase related dependencies I'm using:
Please kindly unblock me.
facing the same on flutter in iOS.
Ok not sure if that is the case for react-native, but for me and flutter, looks like it was a caching issue. Once I do clean with flutter clean (which cleans my XCode workspace, build folder, cache, etc...) it works fine.
Had the same issue but discovered that I was not passing in strings into 'createUserWithEmailAndPassword', I was passing in elements. Once, I switched to strings, I stopped getting auth/network-request-failed error.
I'm still facing this issue with firebase emulator on angular. Is there any solution or workaround for it?
I'm still facing this issue with firebase emulator on angular. Is there any solution or workaround for it? And I'm shocked that it's still open since 2 years.
Well, looks like it's still not fixed because I'm facing the same error.
@code-odyssey-trunk, @SpectorHacked (hope you were not really hacked)
Did you find out eventually what was causing the issue?
I'm facing the same issue and it's a really weird one. I have to switch through the wifi networks and it somehow eventually works...
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Getting an error when running on debug mode on the simulator (both for ios and android)
Steps to reproduce:
Relevant Code:
I created a small react native app to reproduce the bug: https://github.com/shirlev-wix/firebase-bug
Thanks!