Canvas drawImage drawing in website, but not outside of

I’m making a website that has a canvas in it, and it works fine when I run it inside of, but when I run it outside, some of the images don’t show up.

Here is the code that makes them appear when the canvas is clicked.

Game.canvas.onclick = function(event) {
   Game.mousex = event.pageX
   Game.mousey = event.pageY
   if (Game.selected == 'lummox') {
   Game.lummox = new Game.Lummox(Game.mousex,Game.mousey)
and in a different place.
      const g = setInterval(function() {
        for (let i = 0; i <; i++) {

And this is all after the images have been loaded.

Can someone tell me why this is happening?

Hey, @DRMAN welcome to the forums.

Can you please share the link to the repl?

Edit: fixed link

Looks like you tried to post a join link. That lets anybody edit the code and delete it all. Can you please share a link to the cover instead?

Is this is the Repl? thing - HTML, CSS, JS Repl - Replit

It seems to work fine for me…
In Chrome:

In Replit (on Chrome):

I tried on my mobile and result was opposite to yours. Though I couldn’t debug because my mobile couldn’t handle your functions.