Firebase-js-sdk: Error: firebase auth/network-request-failed with sw-precache's navigateFallback

Created on 22 May 2017  路  7Comments  路  Source: firebase/firebase-js-sdk

[READ] Step 1: Are you in the right place?

  • For issues or feature requests related to __the code in this repository__
    file a Github issue.

    • If this is a __feature request__ make sure the issue title starts with "FR:".

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: Windows 10
  • Firebase SDK version: 3.6.3
  • Library version: 3.6.3
  • Firebase Product: auth

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Error: auth/network-request-failed

Relevant Code:

signInButton.onclick = () => {
  const provider = new firebase.auth.GoogleAuthProvider();
  firebase.auth().signInWithPopup(provider);
};
auth

Most helpful comment

All 7 comments

Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.

This issues does not have all the required information. Looks like you forgot to fill out some sections: (### [REQUIRED] Step 2: Describe your environment,### [REQUIRED] Step 3: Describe the problem). Please update the issue with more information.

Information is really scarce here.
signInWithPopup will embed a hidden iframe https://[AUTH_DOMAIN]/__/auth/iframe. This is needed to pass back the OAuth result to the page. Can you please provide more context on this?

navigateFallback: 'index.html',
navigateFallbackWhitelist: [/^\/__\/auth\//],

When I enable sw-precache's navigateFallback option will return 404.

https://[AUTH_DOMAIN]/__/auth/iframe => 404

I honestly am not familiar with sw-precache module. I am also forced to speculate on what is going on. Steps to reproduce are needed.
I do not recommend pre-caching anything under /__/auth/.
signInWithPopup will late load gapi.iframes which will then embed /__/auth/iframe. Offline, this will fail with the error you are seeing. However, trying again when the network connection is regained will allow the operation to succeed.

@FluorescentHallucinogen Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

barakd picture barakd  路  3Comments

mohshraim picture mohshraim  路  3Comments

Kosai106 picture Kosai106  路  3Comments

Alex-Mann picture Alex-Mann  路  3Comments

fabianmarcus picture fabianmarcus  路  3Comments