-
Notifications
You must be signed in to change notification settings - Fork 276
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
Offline mode doesn't work in Firefox #1645
Comments
That may be a red herring. After locally removing the index.html dependency on googletagmanager.com and confirming it is no longer used by index.html in the browser, the error still occurs. |
@bgrgicak, I wanted to know more about the Offline work and spent more time looking at this, setting fetch breakpoints in the service worker and in the main page dev tools, and comparing request URLs with those satisfied from the cache. AFAICT, there don't appear to be any files not found in the cache. Those logs are here. There are 28 entries, 14 fetches and 14 corresponding cache hits. And in the dev tools Network tab, there were 14 requests logged. I didn't notice any differences between the 14 file names but did not confirm entry by entry. I also spent time trying to find the origin of the "NetworkError when attempting to fetch resource" error but haven't had any luck. I was eager to help out and have a fix waiting as you started your day, but it didn't work out. :) I'm curious what you will find here. It will be super interesting to learn the source of this issue. |
It's ok for GTM to fail. It also fails in Chrome because we don't cache it. |
Thank you! It felt really good seeing that you helped. 🙂 |
When I check the network requests while offline and compare it to online, it stops before requesting the SQLite plugin. This plugin isn't preached, so I assume that there is something different in how FF fetches these files from cache. I can see the file in cache. When online the file is fetched from the server and not returned by the service worker. In Chrome it's returned by the worker. |
Ah, good call, comparing between online and offline requests. I poked at this a bit more at the end of the day but unfortunately don't have more to share. |
It seems like all I'm able to open both these files in a new tab, but somehow firefox cannot fetch them at the time the service worker requests them. Two more issues I found in Firefox:
All of these seem like Firefox bugs. Perhaps we can work around them by poking around the worker lifecycle or Aha, I am actually turning my wifi off. The "Work Offline" mode seems to be different from actually being offline so I am not using it. Also, it is so weird this works on a localhost but not on playground.wordpress.net 🤔 |
I wonder if these |
One problem seems to be related to the service worker lifecycle. I'm testing on localhost as follows:
This is what I see on the first page load: If I navigate to admin and then back to the homepage, the CSS is there. This is what we've seen in Chrome before #1643. It doesn't seem to be kicking in in Firefox. This may or may not be related to the larger issue we're seeing on playground.wordpress.net. |
Idea for a short debugging feedback loop:
Alternatively, we could start a staging environment and do that there. |
@adamziel It's possible to debug Service Workers in Firefox today using dedicated dev tools opened via this page: |
Taking this one at @bgrgicak's request |
I took another look at this tonight and was able to reproduce the issue with a website build in Firefox. Now, it is just working:
This is with Firefox v132. It looks like Firefox might have updated this evening as I was testing. Firefox stalled, so I killed it. And after I restarted it, offline mode seemed to work just fine. @bgrgicak would you be up for doing a quick test with Firefox v132 to see if it is working for you as well? |
Thank you for testing this. :) So this became slightly harder to test because we apparently can't use a loopback address. Good thought to test the actual Playground site. |
Offline mode works in Chrome and Safari, but throws an error in Firefox.
Recreate
The text was updated successfully, but these errors were encountered: