Firebaseui-web: google api iframe error

Created on 23 Jan 2017  路  32Comments  路  Source: firebase/firebaseui-web

steps to reproduce this

  1. OSX 10.11.6 , chrome Version 55.0.2883.95 (64-bit)

  2. incognito

  3. https://fir-ui-demo-84a6c.firebaseapp.com/
    Try several times, if this error is not coming up.

There are two issues in the screenshot below.
I am not sure the first one causes other issues, but following errors occur randomly when the first one is present.

Uncaught TypeError: r[t] is not a function
    at Object.Y.x.(anonymous function) [as loaded_0] (https://apis.google.com/js/api.js?onload=__iframefcb799082:10:484)
    at https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en._gEgtcvh1fE.O/m鈥=1/ed=1/am=AQ/rs=AGLTcCNp1OHO8NH9OIu_qsqhhE2s-Jq6qA/cb=gapi.loaded_0:1:15
Y.x.(anonymous function) @ api.js?onload=__iframefcb799082:10
(anonymous) @ cb=gapi.loaded_0:1
iframe.js:118 XHR finished loading: GET "https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=AIzaSyBgcSHxbo93P-N9Sh-ZIqgzvwicHDk_Skc&cb=1485132920219".
H.send @ iframe.js:118
Q.hj @ iframe.js:172
zh @ iframe.js:171
(anonymous) @ iframe.js:176
E @ iframe.js:85
Ch @ iframe.js:176
(anonymous) @ iframe.js:184
e.Wb @ iframe.js:89
Ce @ iframe.js:93
ye @ iframe.js:93
E.Oh @ iframe.js:92
ge @ iframe.js:85
firebase.js:180 Uncaught Error: Network Error
    at ontimeout (firebase.js:180)
    at api.js?onload=__iframefcb799082:10
ontimeout @ firebase.js:180
(anonymous) @ api.js?onload=__iframefcb799082:10
firebase.js:81 Uncaught Q {code: "auth/network-request-failed", message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred."}
(anonymous) @ firebase.js:81

image

Most helpful comment

I accidentally was able to consistently (well enough to find the pattern) replicate this on my workstation when I emulate an iPhone in Chrome developer tools. FirebaseUI internally creates a copy of the original Auth instance so that Auth state changes are not triggered prematurely on the original instance before the sign in process is completed. The problem is both instances (issue is in the core firebase-auth.js sdk) were late loading gapi external library and in the process a race condition was encountered, we are changing the logic so multiple instances share the same late loading mechanism and do not clobber each other.
I think this seems to be the mostly likely reason for this issue. It should be fixed and released next week. I will ping this thread when it's ready.

I apologize for the frustration in this issue. It is genuinely hard to fix a bug when we cannot replicate it.

All 32 comments

Hi @zirho I tested in:
OSX 10.12.2
Chrome Incognito Version 55.0.2883.95 (64-bit)
I was unable to replicate this.
The first issue seems to be causing the second problem. I don't know why this is happening in your case though. I will test again tomorrow.

My colleague was able to recreate this when simulating extremely slow network conditions. We are working on increasing the timeouts to be more accommodating to such conditions.

@bojeil-google

Thank you for the awesome project and support!

I checked this at home and work.
Both work just fine now.

Thanks!

Hey @zirho, we haven't pushed the change yet. I will update this post when it's out. I think this explains the flaky nature of this. You may be checking this in places where maybe the network connection is slow and the connection is timing out whereas other places it is working fine.

Hello and thanks for this excellent project as well. I just ran into this very same issue myself. However for me, it has been the network error every time.

Is there a way to access a nightly build of some kind. Thanks!!

I'm having the same issue, and I confirm that it's mostly for users having a 2G connection (and some users on 3G)

I can confirm that this error is occurring in pretty fast internet as well. No other applications are having any trouble with network.

I can confirm that I am also getting the error on a very fast network.

I'm getting a similar error on my test website.

Uncaught TypeError: r[t] is not a function
    at Object.Y.x.(anonymous function) [as loaded_0] (https://apis.google.com/js/api.js?onload=__iframefcb421422:10:484)
    at https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.tHdj510e-ns.O/m鈥=1/ed=1/am=EQ/rs=AGLTcCPCdLwDRn3a06BckU1EcHEnBiuC1g/cb=gapi.loaded_0:1:15

It occurred intermittently at one point, now most of the time!!

(note that I am changing the website code in the coming few days to avoid a dependency with this UI library, because of this error)

Firebase Auth had significantly increased the network timeouts since this issue was reported. Latest version is 3.6.9. I recommend you switch to this. Previous timeout was 10 seconds. Now it should be 30 seconds. So far the only tangible environment provided in this thread is @zirho's OSX 10.11.6 , chrome Version 55.0.2883.95 (64-bit) - incognito. I have tested in OSX 10.12.2 chrome 56.0.2924.87 (64-bit) incognito. I was not able to replicate this issue.
Please give me a reliable way to recreate this. We can't fix something we can't recreate. We need specific environment data and clear actions to trigger to replicate this.

I can replicate this error too (on both low speed and high speed internet).

@calclavia could you provide more information about your configuration (browser name and version), the SDK version you're using, as well as the console logs? Thanks!

happens always for me

System: Host: mint-pro Kernel: 4.4.0-64-generic x86_64 (64 bit) Desktop: Cinnamon 3.0.7
Distro: Linux Mint 18 Sarah
Chrome: Version 57.0.2950.4 (Official Build) dev (64-bit)

Uncaught TypeError: r[t] is not a function
    at Object.Y.x.(anonymous function) [as loaded_0] (https://apis.google.com/js/api.js?onload=__iframefcb263354:10:484)
    at https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.pt_BR.ynStCtfM3tQ.鈥=1/ed=1/am=AQ/rs=AGLTcCNeeUo3StI7MVUfX1YW2rU7o2AI0g/cb=gapi.loaded_0:1:15
Y.x.(anonymous function)    @   api.js?onload=__iframefcb263354:10
(anonymous) @   cb=gapi.loaded_0:1

@TMSCH I'm using latest version of Chrome. The error I receive is same as @cescoferraro

@cescoferraro @calclavia thanks for the further informations! Could you confirm that you are using the latest version 3.6.10?

@calclavia and what version of the Firebase SDK? (FirebaseUI does not come with the Firebase SDK directly, you have to include it yourself, for instance using the Web snippet of the Firebase console)

@TMSCH Ah, for Firebase SDK, I was using <script src="https://www.gstatic.com/firebasejs/3.6.9/firebase.js"></script>

I'll try the latest version!

I get this error as well, pretty much every time. I've tried from two different locations (both with fast connections) and from Chrome 57 and Firefox 52 on Ubuntu 16.10 and Chrome 57 on Windows 10.

I'm using firebase-web 1.0 from npm and I've tried firebase sdk 3.7.4, 3.7.1, and 3.6.10 with the same results in each. One strange thing is that I sometimes get a different Google account chooser but I can't find a rhyme or reason as to why. One looks newer than the other, but they both have the same options.

Strangely, I just tried with firebase sdk 3.6.4 and it seems to work. I still see the "Uncaught Type Error" mentioned above, but with 3.6.4, it redirects and I log in. Wit 3.6.10 or newer, I see the error and it just hangs.

Let me know if there's any other information you'd want or need.

Thanks!

I can also repro on Chrome Version 57.0.2987.133 (64-bit) on OSX Sierra 10.12.3.

@bojeil-google I'd be happy to hop on a call if you're interested in debugging.

@Andorbal and @MatthewDailey I have tested in Chrome 57 on OSX 10.12.3, Ubuntu, Windows 10 and I still can't reproduce this. If there was ever a bug I really wanted to occur in front of me, it would be this one. The only time I was able to reproduce this bug was in the slow network case which was fixed.
As this case is being reported in the demo app which works perfectly in multiple browsers on our end, there must be something unique to your environment which I am unable to figure out. Firebase Auth late loads the Google gapi external library "https://apis.google.com/js/api.js" for some iframe related operations. It then tries to embed the iframe and communicates with it. Somewhere along is where this error seems to occur. From the data observed here, this issue seems to be flaky. It occurs at times or in certain environments which makes debugging harder.
I would recommend investigating what could be causing any of the above to fail such as browsers settings, network logs, etc. Test the same browser on a different device/network, etc. Then compare the differences if one case works where the other doesn't. This should give us a starting point to investigate.

@bojeil-google thanks for the quick reply and explanation! I'll go gather some other machines and get on a different network and report back.

Here's a deployed version of the code that's breaking for me: https://candor-daily-development.firebaseapp.com/

The repro steps are load the page, click 'sign in with google', then click 'sign out'. It may occur on any page load (initial or after signInWithRedirect). Its not 100% but for me doing it ~3 times in succession triggers the issue at least once.

@bojeil-google I was able to stop reproducing the issue with a full chrome reinstall so clearly there was a config issue on my end.

Since the are multiple people with this bad config, there is a bug that my users could hit and a chrome full reinstall is a brutal fix. Id appreciate if you can dig in but understand that without a repro that's very very hard.

Am seeing this issue too and it's completely borked my app's sign-up process. Have tried on WiFi and mobile networks across multiple browsers. @bojeil-google, is there any progress from your side? This is a disaster.

I accidentally was able to consistently (well enough to find the pattern) replicate this on my workstation when I emulate an iPhone in Chrome developer tools. FirebaseUI internally creates a copy of the original Auth instance so that Auth state changes are not triggered prematurely on the original instance before the sign in process is completed. The problem is both instances (issue is in the core firebase-auth.js sdk) were late loading gapi external library and in the process a race condition was encountered, we are changing the logic so multiple instances share the same late loading mechanism and do not clobber each other.
I think this seems to be the mostly likely reason for this issue. It should be fixed and released next week. I will ping this thread when it's ready.

I apologize for the frustration in this issue. It is genuinely hard to fix a bug when we cannot replicate it.

@bojeil-google Appreciate the hard work. Thank you.

@bojeil-google - just curious, if you can please paste the errors here for what you could replicate consistently. Is it the same in Original Post?

The error is:
Uncaught TypeError: r[t] is not a function
at Object.Y.x.(anonymous function) [as loaded_0] (https://apis.google.com/js/api.js?onload=__iframefcb908474:10:484)
at https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.ok8sahMHDTA.鈥=1/ed=1/am=gQ/rs=AGLTcCOwg5o3rE7_G16P3IYKXV5ZMAP_xg/cb=gapi.loaded_0:1:15

I am getting the same error.
I have the latest version (3.9.0) of firebase and the latest version (1.0.1)
of firebaseui.
When I was logged in it didn't It happen, the moment I cleared my local storage the error appeared.
Are there any news about this issue?

The fix should be coming out this week.

The fix should be out now: https://firebase.google.com/support/release-notes/js#4.0.0
Note you will need to use FirebaseUI-web 2.0.0 as 4.0.0 contains breaking changes.

Was this page helpful?
0 / 5 - 0 ratings