Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
Admin (1 edit) (+1)

The 403 error typically appears if you are trying to reference a path does not exist by your game. (It’s not the more commonly seen 404 error due to the security policy of the storage bucket)

Please read the common pitfalls section of our HTML guide here: https://itch.io/docs/creators/html5#common-pitfalls

Specifically these points:

  • Attempting to access a path that doesn’t point to a file – If you attempt to load a resource that doesn’t point to a file the request will fail. This includes attempting to access a folder (paths ending in /) instead of a specific file. Due to our security settings, our system will return a 403 error instead of the more commonly seen 404. (In Chrome you may see net::ERR_ABORTED 403).
  • Using absolute paths instead of relative paths – Your project is hosted on a subdirectory on our HTML CDN. If you use an absolute path in your sourcecode then it will cause the browser to attempt to make a request outside of the path of your project, and the request will fail. Absolute paths are paths that start with a /. You must use relative paths to access other files you have provided in your project.
  • Mismatched cases when referencing files – The server that hosts your project’s files is case-sensitive. MacOS and Windows computers allow for files to be loaded case-insensitive. It’s possible your project works locally on your computer but fails after you upload it. Please check that all files you reference use the exact case that is shown on your file manager. This is commonly associated with a net::ERR_ABORTED 403 error in Chrome. If you have a file named Hello.png, you must reference it as Hello.png, things like hello.png and HELLO.png will not work because the case does not match.

@leafo thank you very much!

This explanation showed that there are no restrictions on file types or how we load them that prevent HTML from loading. So I rigged a little deeper and it turned out that Phaser asset loader allows different path specifications when the game is hosted in domain's main folder, but more "strict" in terms of how it finds assets if the game is inside some other folder. 

That's why the game worked fine locally on localhost and on it's website, but on itch.io where path is like "https://html-classic.itch.zone/html/10661524/dist/assets..." it failed.

I will change the code to make it work. Hope it can be useful for other people who might run into similar problem.