Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Of course you're getting that error when opening a local file directly. You need to use a web server. On itch.io you already have one by definition, so it should work.

Thanks for your help! What would be the best way to be able to run the same code either on my own machine or through itch.io, and have it work either way (if there is one)?

Use Apache HTTP Server or something similar to run it from local host.

This is what I use to turn a folder on my machine into a localhost:3000 site: https://www.npmjs.com/package/http-server