Skip to content
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

[firebase.js line 72] Uncaught Error: The popup has been closed by the user before finalizing the operation. #94

Open
jltk opened this issue Sep 19, 2016 · 19 comments
Assignees

Comments

@jltk
Copy link

jltk commented Sep 19, 2016

I'm following the Polymer Firebase PWA Tutorial on codelabs and getting this console error when trying to run the site after Step 22:

Uncaught Error: The popup has been closed by the user before finalizing the operation. -- on line 72 of firebase.js

Even though I don't click anything.

note-app.html

<link rel="import" href="bower_components/note-app/common/note-app/na-elements.html">
<link rel="import" href="bower_components/app-storage/app-indexeddb-mirror/app-indexeddb-mirror.html">
<link rel="import" href="bower_components/polymerfire/polymerfire.html">
<dom-module id="note-app">
  <template>
    <style include="note-app-shared-styles"></style>
    <na-toolbar
      signed-in="[[signedIn]]"
      on-sign-out="signOut">
    </na-toolbar>
    <na-login
      on-sign-in="signIn"
      signed-in="[[signedIn]]"
      disabled="[[!online]]">
    </na-login>
    <firebase-auth
        id="auth"
        app-name="notes"
        provider="google"
        signed-in="{{signedIn}}"
        user="{{user}}">
    </firebase-auth>
    <paper-fab
      icon="add"
      on-tap="create"
      disabled="[[!online]]"
      aria-label="Add note">
    </paper-fab>
    <na-editor
      id="editor"
      note="{{editableNote}}"
      on-close="commitChange">
    </na-editor>
  </template>
  <script>
    Polymer({
      is: 'note-app',

      behaviors: [Polymer.NoteAppBehavior],

      signIn: function() {
      this.$.auth.signInWithPopup();
    }
    });
  </script>
</dom-module>

index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
    <title>Notes</title>
    <link rel="manifest" href="manifest.json">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="application-name" content="Notes">
    <meta name="theme-color" content="#353C58">
    <link rel="icon"
      sizes="192x192"
      href="bower_components/note-app/common/images/icon-4x.png">
    <style>
      body {
        margin: 0;
      }
    </style>
    <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
    <script src="bower_components/web-animations-js/web-animations.min.js"></script>
    <link rel="import" href="bower_components/platinum-sw/platinum-sw-elements.html">
    <link rel="import" href="bower_components/polymerfire/firebase-app.html">
    <link rel="import" href="note-app.html">
  </head>
  <platinum-sw-register
    auto-register
    skip-waiting
    clients-claim
    reload-on-install
    href="sw-import.js">
    <platinum-sw-cache
      default-cache-strategy="networkFirst">
    </platinum-sw-cache>
  </platinum-sw-register>
  <firebase-app
    name="notes"
    api-key="AIzaSyBWFANLqngLRRA1c8MJ5t-6FOdqz7NUFiY"
    auth-domain="noteapp-5a95a.firebaseapp.com"
    database-url="https://noteapp-5a95a.firebaseio.com">
  </firebase-app>
  <body>
    <note-app></note-app>
  </body>
</html>

Any help is appreciated.

@machados
Copy link

I've found the same issue and I would like to add that it works as expected in Safari but not on Chrome for Mac.

@jltk
Copy link
Author

jltk commented Oct 2, 2016

Yes, I forgot to add that I was testing it with the latest Chrome version for Windows.

@johnqiuwan
Copy link

I run into the same issue as you guys

@akki9c
Copy link

akki9c commented Oct 20, 2016

I too face the same issue in latest chrome in window. some times pop up just open by clicking on sign in then just closed and throw an error:

Uncaught Error: This domain (smartmulticlipboard.com) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.

Even I added my domain in Authorized domains list.

Update comment: It works for me after adding both format of domain in Authorized domains list i.e
www.example.com and example.com. I hope this helps someone. Thanks!

@glennss
Copy link

glennss commented Oct 26, 2016

Also got this error, any answer yet ??

@fdambrosio
Copy link

I have the same problem , do you have a solution?

@Venryx
Copy link

Venryx commented Nov 12, 2017

This issue shows up for a user of my site (https://debatemap.live) as well. Not yet sure what's causing it.

The error message in Sentry is just:

Error: Network Error
  at Tg/</</</e< (~/firebase/auth.js:144:29)
  at wrapped (~/raven-js/src/raven.js:298:1)

browser = Firefox 56.0
browser.name  = Firefox
environment = production
level = error
logger = javascript
os.name  = Windows 7
sentry:release = 0.0.1
sentry:user = ip:39.57.143.117
transaction = firebase/auth in Tg/</</</e<
url = https://debatemap.live/

The code triggering the error is between the "==========" lines in the code below (there isn't source-code access, so I had to prettify the minified code, and the marked section was on one line):

var Tg = function(a) {
        return Wg().then(function() {
            return new C(function(b, c) {
                M("gapi.iframes.getContext")().open(Vg(a).value(), function(d) {
                    a.ac = d;
                    a.ac.restyle({
                        setHideOnLeave: !1
                    });
                  
==========
                    var e = setTimeout(function() {
                            c(Error("Network Error"))
                        }, Xg.get()),
                        f = function() {
                            clearTimeout(e);
                            b()
                        };
                    d.ping(f).then(f, function() {
                        c(Error("Network Error"))
                    })
                })
            })
        })
    };
Ug.prototype.sendMessage = function(a) {
    var b = this;
    return this.Uc.then(function() {
        return new C(function(c) {
            b.ac.send(a.type, a, c, M("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))
        })
    })
};
==========

And the error message displayed by the window.onerror catcher is just:

An error has occurred: The popup has been closed by the user before finalizing the operation.

Additional info from user:

No, pop-ups are not disabled. The window showed up and I chose my account, it closed itself and then your app flashed a message on the page. I tried signing in, but like my girlfriend, it wouldn't let me.

Any ideas?

@Guria
Copy link

Guria commented Mar 13, 2018

Have very similar issue here.
SignIn working fine on desktop Chrome, but attempt on my OnePlus 5 with latest Chrome fails with "The popup has been closed by the user before finalizing the operation". Popup appears correctly and autocloses after successful login.

Using firebase@4.11.0 from npm

@newbeeios
Copy link

Any answer for this yet? I have the same problem

@Guria
Copy link

Guria commented Mar 20, 2018

@newbeeios I have solved my by adding ip of my machine to allowed list in firebase auth settings

@newbeeios
Copy link

newbeeios commented Mar 20, 2018 via email

@DarshanGowda0
Copy link

@newbeeios and @Guria I had the same problem on my One plus 5, I changed the sign-in method to signInWithRedirect() instead of signInWithPopup() and it works perfectly.

@schankam
Copy link

schankam commented Sep 7, 2018

Same issue here, does not work when my app is run in production mode. But works in dev !

@Franweb79
Copy link

Franweb79 commented Nov 7, 2018

Same issue here, does not work when my app is run in production mode. But works in dev !

I solved it adding the domain on the authorized domains on Firebase console (it is in authentication field).

@Christilut
Copy link

I'm also sporadically getting this error.

Safari 13.0.2, OSX 10.15

@PixsaOJ
Copy link

PixsaOJ commented Jun 30, 2020

Adding domains is not fixing it, I'm on Firefox using multi-account containers (same container for git and the website or localhost)

@oybek9508
Copy link

It works on safari. At first, I also encountered the same issue. And then, I used safari instead of chrome until I finished everything with firebase. Then, once I finished every firebase stuff, it also started working on chrome.

@anhnbt
Copy link

anhnbt commented Feb 18, 2021

I went to Firebase > My Project > Authentication> Sign-in providers > Enable google and it worked

@ed-workbase
Copy link

Just wanna followup that I also had this and after adding the correct Auth providers in firebase, I also had to add to the website restrictions on my Browser Key in GCP console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests