# ServiceWorker script evaluation failed due to HTTP (not HTTPS)

**URL:** https://meta.discourse.org/t/serviceworker-script-evaluation-failed-due-to-http-not-https/124800
**Category:** Support
**Created:** [August 3, 2019, 7:19pm UTC](https://meta.discourse.org/t/serviceworker-script-evaluation-failed-due-to-http-not-https/124800 "2019-08-03T19:19:14Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [August 4, 2019, 6:02pm UTC](https://meta.discourse.org/t/serviceworker-script-evaluation-failed-due-to-http-not-https/124800/11 "2019-08-04T18:02:01Z")

</div>

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.

> [@Full URL in assets erb file --\> multisite issues](https://meta.discourse.org/t/full-url-in-assets-erb-file-multisite-issues/124393):
>
> The new workbox service worker implementation uses UrlHelper.absolute. Since this is a compiled asset, it stores the full URL, containing the full hostname of the primary host in a multisite environment. [https://github.com/discourse/discourse/blob/master/app/assets/javascripts/service-worker.js.erb#L3-L6](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/service-worker.js.erb#L3-L6) I think it should be using UrlHelper.local\_cdn\_url instead. This also circumvents the need to recompile assets after changing the hostname.

In this specific case, the assets were probably built before `force_https` was turned on.  
Rebuild and you’ll be fine.

---

_[View the full topic](https://meta.discourse.org/t/serviceworker-script-evaluation-failed-due-to-http-not-https/124800)._
