-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Reading a property of null in some cases in SW mode #520
Comments
I don't remember the exact scenario, but I was switching from a git branch to another branch. |
Unfortunately I don't think this issue is fixed. In trying to deduplicate code between app.js and service-worker.js in #556, I came across this error, and it seems reproducible on master in Chromium. I cannot reproduce the error on Edge classic or on Firefox Quantum. Therefore I believe it's a timing issue / race condition due to the way Chromium loads the Service Worker. Steps to reproduce on Chromium (running master from localhost): Simple version
Steps to reproduce while completely clearing and reloading Service Worker (to be ultra-sure)
|
@mossroy Maybe this error could be solved with code from https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/ready , e.g.
|
OK, on https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/controller I find this:
Doh! I guess this is to force reload a Service Worker (?) when Devs are testing. Can we therefore ignore? It seems Chromium is the only browser written to spec here, or else I don't know how to issue a force refresh in the other browsers. I'll test a bit more to see if it's only on force refresh that the error occurs. |
I think this is a different problem, as it's not the same variable that is null. You should open another github issue. |
OK, but I think I found the cause of this error (as stated above) since it only occurs on force refresh and only in Chromium. Therefore I think it's an artefact, not a real error (or rather, it's "by design" in Chromium). If it appears in some meaningful way, I'll open an issue. For now, I'll just close this. |
When doing some tests in SW mode on Chromium, I had the following error twice :
Cannot read property 'documentElement' of null
which happened on line 909 of app.js
It's a line we recently added. We also added a few null tests, but it looks like we need to add another one
The text was updated successfully, but these errors were encountered: