excaliburjs / template-ts-vite

Excalibur Template with TypeScript for Vite
BSD 2-Clause "Simplified" License
36 stars 7 forks source link

Production bundle can't run on itch.io #28

Closed nilskj closed 2 years ago

nilskj commented 2 years ago

Steps to Reproduce

Expected Result

Game should work, as it does if using the webpack or parcel templates

Actual Result

Screen stays gray, user gets 403 error (forbidden). See https://nilskjql.itch.io/excalibur-vite-test image

Environment

Current Workaround

For a game jam I uploaded the prod bundle to netlify and then it worked, but not optimal in any way.

nilskj commented 2 years ago

Nevermind I think this is a problem at itch.io. Vite puts assets in a subfolder and that makes it problematic to run on itch. Webpack puts the whole bundle and files in the same folder with relative imports. Read this: https://itch.io/docs/creators/html5#common-pitfalls.

If I just rewrite the hrefs to be relative instead of absolute this works. I think this is more of an issue with itch.ios html5 player then this template, closing this issue.

eonarheim commented 2 years ago

@nilskj this is a good piece of info, I might add this to our documentation. It might be useful to have a section in our documentation around hosting platforms like itch and any of these pitfalls.

@kamranayub @jedeen What are your thoughts?

kamranayub commented 2 years ago

Anything that helps when we know there are issues seems good 😊