User verilog15 reports a ServiceWorker registration failure due to HTTP (not HTTPS), visible in dev-tools after installing plugins. Initial troubleshooting by Falco suggests checking force_https in site settings — though it’s hidden if Let’s Encrypt is enabled. verilog15 confirms not seeing the setting and seeks guidance. codinghorror suspects a botched install, while pfaffman notes that force_https is auto-enabled with Let’s Encrypt and may relate to recent regressions or email links. Falco asks if a reverse proxy is configured and guides verilog15 to check force_https via Rails console. RGJ identifies the root cause: assets were built before force_https was enabled — rebuilding should fix it. verilog15 rebuilds multiple times but still sees the error, sharing app.yml screenshots. Falco provides console commands to verify force_https, which verilog15 confirms is true. After recreating the DigitalOcean droplet and reinstalling, the error persists. Falco pushes a fix targeting WorkboxJS URLs in the service worker. pfaffman asks if this affects summary emails; Falco clarifies it doesn’t — the issue likely remains asset-related per RGJ.
I’m not sure where to start debugging this.
Searching for the message “Failed to register Service Worker: TypeError: Failed to register a ServiceWorker: ServiceWorker script evaluation failed” on Google suggests there is a problem with the JS but I’m don’t know where it is coming from.
Have anybody got this issue before?
Force https is enabled and hidden if let’s encrypt is enabled. There was another topic recently that had http links in summary emailsv(Configuring Activity Summary emails - #29), Could there be some regression with the code that sets the override env variable? Or something like that?
I used the following guide to enable HTTPS: Set up HTTPS support with Let's Encrypt.
Maybe it’s outdated or maybe I should have used another guide? I set there the env “LETSENCRYPT_ACCOUNT_EMAIL”.
New to rails, so is it possible to explain which run in order to check the value of force_https?
This is the same issue as this one (although surfacing under different circumstances)
Having a hostname / full URL in an asset is guaranteed to cause trouble.
In this specific case, the assets were probably built before force_https was turned on.
Rebuild and you’ll be fine.
I use DigitalOcean and I destroyed the droplet and made a new one. I followed the steps (without using the guide I mentioned before, rather the script). But I still got the same error.
After running the commands I get: