Comments (12)
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.
from firebase-js-sdk.
There are many reasons why network errors could occur.
Please provide details on your issue. The first thing you need to do is report network logs. Check the network call that is failing and please report it with full details.
I doubt this happens because of the browser tab plugin. It is hard to speculate on the exact reason with no data available.
Are other calls failing at the same rate? Can you check signInWithEmailAndPassword? This would help clarify if this is related to a network request to the Firebase Auth backend or something else client related.
Underneath, we also check navigator.onLine to check the status of the connection. Can you confirm this returns true when the connection fails?
from firebase-js-sdk.
What specific network logging will be helpful?
My initial post stated that signInWithEmailAndPassword works fine and still does consistently,, so I do not suspect it's a drop in connectivity.
I'm running the sample code provided by Google documentation. It's falling into the catch for getRedirectResult.
firebase.auth().signInWithRedirect(provider).then(function() {
firebase.auth().getRedirectResult().then(function(result) {
// This gives you a Google Access Token.
// You can use it to access the Google API.
var token = result.credential.accessToken;
// The signed-in user info.
var user = result.user;
// ...
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
});
});
Step 1 - signInWithRedirect function opens up a browser tab
Step 2 - Credentials are entered into provider's login screen within the browser tab
Step 3 - Browser tab closes, a small loader square shows up in the middle of the page
Step 4 - Error occurs (again, 90% of the time) in getRedirectResult, which is called when the browser tab closes.
Some additional data points:
- This does not happen in browser mode, only Cordova (I only tested on Android so far)
- I switched between cellular and WiFi, and still received the error.
- I suspect there may be some similarities with #20
from firebase-js-sdk.
More info on XHR activity:
Called When Error:
- verifyAssertion?key= (contains JSON response)
Called When Success:
- verifyAssertion?key= (contains JSON response)
- getAccountInfo?key= (contains JSON response)
from firebase-js-sdk.
Ok, just an update. @bojeil-google, I confirmed that my Cordova device was switching between offline and online when I checked 'navigator.onLine'. That would explain why Firebase worked sometimes and not other times. I was wondering why, so I plugged in the 'cordova-plugin-network-information' to determine if more information about my device's connection status. Then it was fixed... works every time. I'm looking now to see if the 'cordova-plugin-network-information' is a more accurate wrapper to 'navigator.onLine'. If so, Firebase Auth may be getting better information and not failing. Stay tuned.
from firebase-js-sdk.
Sounds promising. I suspected there may be issues with navigator.onLine in such environments when I heard recurring reports on network errors in Cordova apps. I just haven't been able to reproduce them to confirm this.
from firebase-js-sdk.
Including the cordova-plugin-network-information corrected this issue for me. I confirmed that the 'navigator.onLine' was occasionally 'false', which I believe was causing Firebase to think there was an issue. Once I added the cordova-plugin-network-information to my project, the problem went away. I didn't dig deep into why, but I suspect this plugin has a better wrapper around the navigator which may be giving Firebase better information. I did confirm this problem came back after removing the plugin, but re-applying it fixes it. I will update this if I dig deeper. I hope this helps.
from firebase-js-sdk.
Looks like this may have been solved in the latest release of Firebase 4.2.0. I'll be verifying when I get a chance.
"Refactored to not use navigator.onLine for offline detection in Cordova environments."
https://firebase.google.com/support/release-notes/js#4.2.0
from firebase-js-sdk.
face the same problem on WKWebView
anyone find the correct solution?
from firebase-js-sdk.
did you guys find out what was happened ?
from firebase-js-sdk.
@mohshraim @wahengchang
in you html file, try to change the Content-Security-Policy default-src 'self'
to default-src *
P.S. hope you didn't give up on you projects because of this problem
from firebase-js-sdk.
@redaelkhayat
Thanks for suggestion, my case was somehow on different environment. but was giving the same error.
this full case 582
that was a bug on google backend. and they solve it
from firebase-js-sdk.
Related Issues (20)
- Firestore doesn't support JavaScript objects with custom prototypes HOT 4
- Signin functions are not resolving with Firebase 10 under capacitor HOT 2
- Typescript types missing when upgrading from 10.2 to 10.3 HOT 3
- FirebaseServerApp could not login user with provided authIdToken in Emulator HOT 3
- IGNORE linkwithphoneNumber is creating a new user
- FR: Add Create Bundles Support HOT 3
- Server App Not Logging In HOT 23
- Can't use getToken() on Safari: `FirebaseError: Messaging: A problem occurred while subscribing the user to FCM: Request contains an invalid argument. (messaging/token-subscribe-failed).` HOT 14
- ` isHostLanguageValid()` in auth's recaptcha loader incorrectly determines long language codes to be invalid HOT 1
- Apple Sign In Blank screen on Web using Chrome 126 HOT 4
- Sign in With Redirect best practice #3 failing HOT 6
- `sendSignInLinkToEmail` only accepts `handleCodeInApp: true` HOT 1
- ReferenceError: self is not defined on Jest tests [email protected] HOT 5
- `signInWithPopup` flow rejects with `auth/popup-closed-by-user` after around 8 seconds HOT 3
- error auth/account-exists-with-different-credential for a new user without any provider HOT 1
- This browser doesn't support the API requested to use by Firebase SDK HOT 3
- Firebase init takes 20s more by "FirebaseAppCheckTokenProvider AppCheck not yet detected"
- User hasn't closed app for a couple of days results in `INTERNAL ASSERTION FAILED: Unexpected state` HOT 3
- Safevalues `TypeError` in Jest Test HOT 3
- `verifyPhoneNumber` errors with `auth/invalid-app-credential` only on localhost HOT 22
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-js-sdk.