Jekyll newbie here with little to no web and javascript experience. I’m using the Hydejack theme for my Jekyll site, and I’m hosting it on a AWS S3 bucket hand routing traffic using a AWS CloudFront distribution.
Symptoms
The site works perfectly well when I test it locally, serving the site through nginx. But the actual site on S3+CloudFront has some issues: https://www.olavur.consulting/
The web developer console log gives the error messages shown below.
Error message
Uncaught (in promise) ChunkLoadError: Loading chunk 3 failed.
(missing: https://www.olavur.consulting/assets/js/drawer-hydejack-9.1.6.js)
e https://www.olavur.consulting/assets/js/hydejack-9.1.6.js:13
<anonymous> https://www.olavur.consulting/assets/js/hydejack-9.1.6.js:28
o https://www.olavur.consulting/assets/js/hydejack-9.1.6.js:13
<anonymous> https://www.olavur.consulting/assets/js/hydejack-9.1.6.js:13
<anonymous> https://www.olavur.consulting/assets/js/hydejack-9.1.6.js:13
hydejack-9.1.6.js:13:1115
Uncaught (in promise) ChunkLoadError: Loading chunk 16 failed.
(missing: https://www.olavur.consulting/assets/js/vendors~push-state-hydejack-9.1.6.js)
e https://www.olavur.consulting/assets/js/hydejack-9.1.6.js:13
<anonymous> https://www.olavur.consulting/assets/js/hydejack-9.1.6.js:28
o https://www.olavur.consulting/assets/js/hydejack-9.1.6.js:13
<anonymous> https://www.olavur.consulting/assets/js/hydejack-9.1.6.js:13
<anonymous> https://www.olavur.consulting/assets/js/hydejack-9.1.6.js:13
It seems that the main javascript:
https://www.olavur.consulting/assets/js/hydejack-9.1.6.js
Tries to dynamically load some other javascript assets, in this case:
https://www.olavur.consulting/assets/js/drawer-hydejack-9.1.6.js
https://www.olavur.consulting/assets/js/vendors~push-state-hydejack-9.1.6.js
But for whatever reason is unable to do so, resulting in a ChunkLoadError
.
What I’ve tried
I’ve tried to use the most lenient possible CSP and CORS settings, so ensure that the requests aren’t blocked. I can see that the browser is downloading all the assets, the HTTP GET
requests to the js assets are successful.