auth0-spa-js: Chrome loading indicator hangs on createAuth0Client

This was tested against Chrome 76, and doesn’t appear to affect Firefox or Safari.

When the client is created, my app is able to successfully make requests to Auth0 without any errors reported. What’s strange is that the browser shows a loading indicator and status “waiting for (my domain).auth0.com” for an indefinite period of time. (Or until unrelated http requests are triggered in the application). There is no pending requests or any activity in the browser that I can see that would indicate an Auth0 request is hanging.

After digging into the source code, it looks like something related to how the iframe is handled with getTokenSilently and the runIframe method…if I comment out the iframe removal from the DOM, Chrome seems to be happy with reporting the app as loaded.

var iframeEventHandler = function (e) {
    // ... //
    e.data.response.error ? rej(e.data.response) : res(e.data.response);
    clearTimeout(timeoutSetTimeoutId);
    window.removeEventListener('message', iframeEventHandler, false);
    // window.document.body.removeChild(iframe); <-- Commenting out circumvents issue
};

This isn’t causing any functional problems, but it’s a confusing experience on the initial load of the app.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 18 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @bvamp, just wanted to come back and say that we’re now tracking this on our backlog - thanks for your patience!

The clientID isn’t secret, but it is private 😃

I’ll open a new issue.