GitHub JavaScript file not loading on mobile

Hello,
We were writing some custom JavaScript on our site but figured that in the future, we will reach the limit of 20.000 characters for custom code.
So we put all our custom script in GitHub pages file and imported it in footer section with

The code works on desktop but it’s not loading on some mobile devices (android)

When I connected the phone to PC and using chrome://inspect/#devices
opened the console, I see a warning:
“The resource was preloaded using link preload but not used within a few seconds from the windows load event.
Please make sure it has an appropriate as value and it is preloaded intentionally.”

For testing purposes, I made a new .js file that has only one console.log(‘aaa’) statement
and it shows on desktop but not on mobile, got the same warning.

Any idea why is this file preloading on mobile and how can i prevent this?


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Hey Milos,

try using cdn’s like jsdeliver instead of github. You can simply change the url to your account and repo/file names. Github generally does not want to be used as a cdn, I didn’t check the response headers from your test file.

1 Like

Thanks RDaneelOliwav, this fixed the issue

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.