# "Cannot Load App".... in Firefox sometimes. Refresh fixes it

**URL:** https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258
**Category:** Support
**Created:** [April 13, 2018, 3:59pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258 "2018-04-13T15:59:04Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![dylanh724](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanh724/32/119642_2.png) [@dylanh724](https://meta.discourse.org/u/dylanh724)
#### Post date: [April 13, 2018, 3:59pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/1 "2018-04-13T15:59:05Z")

</div>

Hello,

I run a standard Nginx reverse proxy with instructions from one of the official tutorials with DigitalOcean.

In the past few weeks, I started to notice (and others, too) random “Cannot Load App” messages when visiting the forum. Just randomly and semi-rarely. Refreshing with F5 instantly shows the site again.

Anyone have any clues?

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/f/0fd373843f20153cd7e24881a0965407592ff218.png)

[https://forum.imperium42.com](https://forum.imperium42.com)

**EDIT** : Plugins –

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/5/e58e0fed9b83b204b09c395b2c903f41a8d5b90d.png)

---

<div class="post-metadata">

### Author: ![Daniel\_Nevoigt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_nevoigt/32/92920_2.png) [@Daniel\_Nevoigt](https://meta.discourse.org/u/Daniel_Nevoigt)
#### Post date: [April 13, 2018, 4:04pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/2 "2018-04-13T16:04:22Z")

</div>

I have the same issue, that always happens when I closed the browser with tabs saved and re open it. Than I get that messege and I need to refresh the page.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 13, 2018, 4:08pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/3 "2018-04-13T16:08:31Z")

</div>

This is on Firefox right?

---

<div class="post-metadata">

### Author: ![Daniel\_Nevoigt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_nevoigt/32/92920_2.png) [@Daniel\_Nevoigt](https://meta.discourse.org/u/Daniel_Nevoigt)
#### Post date: [April 13, 2018, 4:16pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/4 "2018-04-13T16:16:47Z")

</div>

In my case yes, it is

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 13, 2018, 4:26pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/5 "2018-04-13T16:26:11Z")

</div>

Are you starting to have more traffic?

I’ve seen this most often when the server isn’t able to keep up.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [April 13, 2018, 4:43pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/6 "2018-04-13T16:43:37Z")

</div>

I think the message that we send when fetch throws an error is confusing.

```plaintext
      fetch(event.request).catch(function(error) {
        // The catch is only triggered if fetch() throws an exception, which will most likely
        // happen due to the server being unreachable.
        // If fetch() returns a valid HTTP response with an response code in the 4xx or 5xx
        // range, the catch() will NOT be called. If you need custom handling for 4xx or 5xx
        // errors, see https://github.com/GoogleChrome/samples/tree/gh-pages/service-worker/fallback-response
        return caches.match(OFFLINE_URL);

```

If the server is unreachable, it doesn’t mean that the client is offline and I think this is why a lot of people are getting confused.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 13, 2018, 8:55pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/7 "2018-04-13T20:55:13Z")

</div>

What do you suggest as the alternate text? Can we even control the text the browser shows in this scenario?

---

<div class="post-metadata">

### Author: ![Define\_Logan](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@Define\_Logan](https://meta.discourse.org/u/Define_Logan)
#### Post date: [April 13, 2018, 10:02pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/8 "2018-04-13T22:02:26Z")

</div>

Had this happen to us this morning. I rebooted our droplet (digital ocean hosted) and it seemed to resolve the issue.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 13, 2018, 10:18pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/9 "2018-04-13T22:18:01Z")

</div>

> [@Daniel\_Nevoigt](#):
>
> I have the same issue, that always happens when I closed the browser with tabs saved and re open it. Than I get that messege and I need to refresh the page.

This is a bug in Firefox Session Restore feature active in version 59.

Right now I can’t repro this in Firefox 60 beta so I’m assuming they fixed it already.

> [@dylanh724](#):
>
> In the past few weeks, I started to notice (and others, too) random “Cannot Load App” messages when visiting the forum. Just randomly and semi-rarely. Refreshing with F5 instantly shows the site again.

Like @pfaffman said this can be a server problem or anything in between (like you being in a flaky connection).

> [@Define\_Logan](#):
>
> Had this happen to us this morning. I rebooted our droplet (digital ocean hosted) and it seemed to resolve the issue.

Yes, if your server goes down you can see this message too.

---

<div class="post-metadata">

### Author: ![Daniel\_Nevoigt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_nevoigt/32/92920_2.png) [@Daniel\_Nevoigt](https://meta.discourse.org/u/Daniel_Nevoigt)
#### Post date: [April 14, 2018, 10:25am UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/10 "2018-04-14T10:25:43Z")

</div>

> [@Falco](#):
>
> This is a bug in Firefox Session Restore feature active in version 59.
> 
> Right now I can’t repro this in Firefox 60 beta so I’m assuming they fixed it already.

Thanks a lot for the Info

---

<div class="post-metadata">

### Author: ![hexa](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@hexa](https://meta.discourse.org/u/hexa)
#### Post date: [April 15, 2018, 10:27pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/11 "2018-04-15T22:27:16Z")

</div>

FWIW: Seeing this issue on Firefox Nightly 61.

Just went to the Letsencrypt Forum … Cannot load app …  
Then went here to report … Cannot load app.

It’s frustrating ☹

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 15, 2018, 10:46pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/12 "2018-04-15T22:46:05Z")

</div>

I wonder if the support load the offline service worker generates justifies the benefit it provides on desktop, on Android it is fine, but gain on desktop is sketchy

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 16, 2018, 1:09am UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/13 "2018-04-16T01:09:58Z")

</div>

Beta browsers are explicitly not supported, and never have been.. I suggest opening an issue with Firefox on a beta bug.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 16, 2018, 3:33pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/14 "2018-04-16T15:33:51Z")

</div>

I submitted this bug to Mozilla:

> **[1454400 - Session Restore doesn't activate service worker](https://bugzilla.mozilla.org/show_bug.cgi?id=1454400)**
>
> RESOLVED (nobody) in Core - DOM: Service Workers. Last updated 2018-04-17.

Also pinged @LeoMcA to help us.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 17, 2018, 4:27pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/15 "2018-04-17T16:27:22Z")

</div>

Firefox team confirms it’s fixed in Firefox for next release:

> **[Comment 1 - 1454400 - Session Restore doesn't activate service worker](https://bugzilla.mozilla.org/show_bug.cgi?id=1454400#c1)**
>
> RESOLVED (nobody) in Core - DOM: Service Workers. Last updated 2018-04-17.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 17, 2018, 4:27pm UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/16 "2018-04-17T16:27:25Z")

</div>



---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [April 20, 2018, 5:54am UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/17 "2018-04-20T05:54:47Z")

</div>

I had this great idea that we should only display the offline page by figuring out what type of error we’re getting. However…

> A [`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch) promise will reject with a [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) when a network error is encountered or CORS is misconfigured on the server side, although this usually means permission issues or similar

So I experimented locally and get the same error, `TypeError: Failed to fetch`, whether I am offline or whether the server is down. No way of telling why the fetch request fails. The console does log `net::ERR_CONNECTION_REFUSED` but that is not available to us…

Even a Google Engineer wrote this in his [blog post](https://gauntface.com/blog/2015/02/11/fetch-is-the-new-xhr)…

> This is hands down, one of the **worst** error messages I’ve ever seen.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 20, 2018, 7:19am UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/18 "2018-04-20T07:19:06Z")

</div>

Hmmm … how reliable is `navigator.onLine` these days? can we use it.

1. Get an error
2. Check `navigator.onLine`
3. If not online (has property and property is false) then display a different page.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [April 23, 2018, 2:25am UTC](https://meta.discourse.org/t/cannot-load-app-in-firefox-sometimes-refresh-fixes-it/85258/19 "2018-04-23T02:25:11Z")

</div>

Nice I didn’t know about `navigator.onLine`. Since it is [widely supported](https://caniuse.com/#feat=online-status), the service worker will now display the cached offline page only when the user is offline.

[https://github.com/discourse/discourse/commit/d2d3c7d24e733b1db8bd187df1f2b004d18d6ca2](https://github.com/discourse/discourse/commit/d2d3c7d24e733b1db8bd187df1f2b004d18d6ca2)
