hydecorp / hydejack

A boutique Jekyll theme for hackers, nerds, and academics
https://hydejack.com
Other
1.41k stars 799 forks source link

[PRO] ChunkLoadError: Cannot load js assets, drawer does not work #337

Open olavurmortensen opened 9 months ago

olavurmortensen commented 9 months ago

Symptoms

TL;DR: browser is able to download js asset, but hydejack-9.1.6.js gets ChunkLoadError.

The result is that opening and closing the "drawer" doesn't work. If I open the

My site can be found here: https://www.olavur.consulting/

Debugging

When loading the site, there is an error in the hydejack-9.1.6.js script. The script tries to load various other js assets, but fails to load two of them:

The js assets that the function is trying to load are available, so loading them shouldn't be a problem: https://www.olavur.consulting/assets/js/vendors~drawer-hydejack-9.1.6.js

The browser is able to download this file as well, on other words the HTTP GET request is successful.

I've tried this on various browsers, so it is not a simple compatibility issue.

Building site

Working with jekyll v4.3.3 and ruby 3.3.0.

gem install webrick jekyll bundle
bundle install
JEKYLL_ENV=production bundle exec jekyll build

Full error message

Uncaught (in promise) ChunkLoadError: Loading chunk 13 failed.
(missing: https://www.olavur.consulting/assets/js/vendors~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](https://www.olavur.consulting/assets/js/hydejack-9.1.6.js)
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

Question

So my question is, what does the ChunkLoadError actually mean in this case? The asset seems to be available, but why can't this js function load it?