I just pushed a new commit fixing the indentation changes.
diarcastro → created an issue.
@Anybody (#33) having that the loadjs script is loaded in the global scope we don't need to use `window.loadjs = ...` because `var loadjs = ...` will be in the same scope and `window.loadjs === loadjs`, so we don't need to define the variable directly in the window object.
And you are right that's fix should be done in the LoadJS Library instead.
I made a quick example here https://codepen.io/diarcastro/pen/BaqQwxg
I think the problem is because the variable is not defined and if we run JS in a strict mode that error jumps.
I just created a simple patch to fix the issue and the fix is only defining the variable.
It worked for me on Drupal 9.5.x.