How can I resolve a CORS error when loading images from Phaser?

I’ve followed the getting started guide more than twice now, and nothing is mentioned about this. Whether I try with one of the suggestions, http-server, or just a basic Express web server, I get CORS errors on every this.load.image call.

Phaser makes the url based on calls like this in the preload function, this.load.image('sky', 'assets/sky.png'), after setting this.load.setBaseURL('https://labs.phaser.io'). These calls are in my index.html, and the game gets “started” with this.add.image(400, 300, 'sky') I presume. This is all copied straight from the Phaser tutorial website and tutorial source download.

What’s the URL in the address bar? What’s the error message?

It looks like I have gotten over that problem. It was probably because my cdn url in Index.html was pointing to cdn.jsdelivr.net/npm/phaser@3.11.0, not cdn.jsdelivr.net/npm/phaser@3.60.0 like it is now for my working app.

The URL in the address bar was http://localhost:3000, exactly as my Express app was configured. There was nothing wrong with that.