gzuidhof/coi-serviceworker

coi-serviceworker causes page to reload continuously?

sideshowbarker opened this issue · 2 comments

https://stackoverflow.com/questions/68609682/is-there-any-way-to-use-sharedarraybuffer-on-github-pages has comments from the OP and another commenter saying, “the page keep loading again and again” and “This does not work, the crossOriginIsolated is never true, and the page reloads continuosly”

I’ve not been able to reproduce that problem myself — the library works fine where I’ve tried it — but I’m raising this issue to see if it might be possible to resolve the problems for the cases in which other users have encountered it.

I'm not sure about the situation in which this happens, I wouldn't be surprised if there are some versions of old browsers that don't cooperate as they should. If the commenter can detect these browsers they could use shouldRegister to check for this browser and they can share their learnings in a new issue.

Until we have more information we can't do anything actionable here. The trick that coi-serviceworker uses is not necessary for more 'serious' projects - in those cases you should set the required headers on your backend.

FWIW, according to https://stackoverflow.com/questions/68609682/is-there-any-way-to-use-sharedarraybuffer-on-github-pages/68675301#comment129294263_68675301 this issue may occur if coi-serviceworker.js was not served from the top-level directory.