Skip to content
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

Figure out the problem with Service Workers #10

Closed
jonrh opened this issue Jul 14, 2017 · 1 comment
Closed

Figure out the problem with Service Workers #10

jonrh opened this issue Jul 14, 2017 · 1 comment
Labels

Comments

@jonrh
Copy link
Owner

jonrh commented Jul 14, 2017

I believe I have found the problem that blocks me from publishing the website.

HTTP local dev

No errors appear when developing locally.

HTTP, works correctly

When the site is tested on HTTP: http://dev.jonrh.is.s3-website-us-east-1.amazonaws.com/

screen shot 2017-07-14 at 12 13 00

HTTPS, does not work

When the site is tested on HTTPS: https://dev.jonrh.is/

screen shot 2017-07-14 at 12 13 37

The Problem

I suspect that something is broken with the plugin gatsby-plugin-offline. On HTTP Chrome alerts that since the service worker does not have a HTTPS origin it was blocked. Then the site works as expected. However when HTTPS is used there seems to be some error in the service worker and you can not switch between pages.

One way to solve this temporarily would be to try to disable or remove the gatsby-plugin-offline plugin.

@jonrh jonrh added the bug label Jul 14, 2017
jonrh added a commit that referenced this issue Jul 15, 2017
Removed the offline plugin. It is a very nice idea but could not get it to work correctly. To fix the issue it was not just enough to remove the plugin. I had to invalidate the AWS CloudFront edge caches, clear cache in Chrome AND restart the browser.
@jonrh
Copy link
Owner Author

jonrh commented Jul 15, 2017

Fixed in commit d3662d3.

Removed gatsby-plugin-offline. Had to invalidate the CloudFront edge cache and reset Chrome and FireFox pretty hard. Getting rid of cached service workers, sw.js, in browsers is hard. First you have to clear the cache, then you also have to restart the browser. Had to do this in both FireFox and Chrome.

@jonrh jonrh closed this as completed Jul 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant