Javascript .js does not run on refresh

So I have a file called chess.js and I have it running rt now at the top of theme.liquid like below.

I am calling as part of a chess player on the page but what I notice is that the page does not call chess.js on refresh of the page. First call always works.

I have done this so far and nothing has helped.

  1. used defer and async in all parts of head, and I also used at the bottom of body.

  2. I have cleared browser cache and nothing changed

I am so clueless as to why this happens once the changes were made and after the first call subsequent refreshes I don’t see the javascript chess player.

HI @satishshekhar

You should not use ‘defer’ and ‘async’ if it’s main library


I did move the call to chess.js to the featured blog file. It works now and I am not using async or defer but it confounds me why on some page refreshes, I don’t see the player but in some I do.