Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Itch Upload Web Zip Can't Load Own Files

A topic by Quackers Dev Team created 31 days ago Views: 89 Replies: 3
Viewing posts 1 to 4
(1 edit)

Hi, I'm using the ci scripts for my project here (built off of the ones from this original project to build and compile a web wasm project (actually it makes native builds too, but the one I care about now is the web one).

It builds and deploys fine from github actions point of view. On the page for the game ( https://quackers-game.itch.io/quackers-beta )

It shows the error message:

There was a problem loading your project:

Failed to find index.html

Please try deleting the ZIP file and uploading another one.


Is there any way to see more info about why it failed? I don't see anything in the browser console or any link to see logs...


When I download the zip and open it I can see the index.html, 2 js files, and an assets folder:





The index.html loads the js files like this:
```

const wasm = await init('./quackers-beta-2467b0637f6303cf_bg.wasm');

window.wasmBindings = bindings;

dispatchEvent(new CustomEvent("TrunkApplicationStarted", {detail: {wasm}}));

</script>

<link rel="modulepreload" href="./quackers-beta-2467b0637f6303cf.js" crossorigin=anonymous integrity="sha384-rWkz67zH+BjvPdl/cLDQUBqfiboFB2aG8JMWYhiKuT+sbfH0hF4YkPro3xcxiucR"><link rel="preload" href="./quackers-beta-2467b0637f6303cf_bg.wasm" crossorigin=anonymous integrity="sha384-OPoajXHNf0RIuLSmdexB03knQgb3QZ2/qUCR7FFjprN1BtWg7rUoBw5zvybq5d2r" as="fetch" type="application/wasm"></head>

```


If I try to open the index.html in the browser I see these errors in the console:



The `integrity` attribute is currently ignored for preload destinations that do not support subresource integrity. See https://crbug.com/981419 for more informationUnderstand this warning


index.html:1 Access to script at 'file:///Users/jim/Downloads/quackers-beta%202/quackers-beta-2467b0637f6303cf  .js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.Understand this error

index.html:135 
        

       GET file:///Users/jim/Downloads/quackers-beta%202/quackers-beta-2467b0637f6303cf.js net::ERR_FAILEDUnderstand this error

index.html:1 Access to link element resource at 'file:///Users/jim/Downloads/quackers-beta%202/quackers-beta-2467b0637f6303cf_bg.wasm' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.Understand this error

index.html:135 

   

       GET file:///Users/jim/Downloads/quackers-beta%202/quackers-beta-2467b0637f6303cf_bg.wasm net::ERR_FAILEDUnderstand this error

index.html:1 The resource file:///Users/jim/Downloads/quackers-beta%202/quackers-beta-2467b0637f6303cf_bg.wasm was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.


Could this be part of the issue of why itch.io can't load the files? ðŸ¤”



I was assuming itch.io could load multiple files in the zip, right?


It's weird because it does work if I try to deploy a fresh scaffold of the 2d project, but when I try to deploy mine it doesn't... 


I am also using this line "wasm_websocket::Client::new(&url);" to connect to my websocket server on some other secure wss domain... could that be part of the issue here?


While deploying I've been running it in the browser locally with this command: 

trunk serve --no-default-features


Appreciate if anyone has ideas on how I can troubleshoot this. Thanks!

hmmm the weird part is that I was able to deploy a fresh scaffold of the bevy 2d here: https://jimlynchcodes.itch.io/ducks-quickstart

And when I open up the zip it looks EXACTLY the same... 

Does the name of the zip matter?

maybe I need to do something extra to allow it to call to my external server?

It would be really helpful if I could see the logs of what's ACTUALLY the problem because I don't think the "can't find index.html" error is totally accurate...

WOOOOOOOOOWWWWWWWW ok I feel dumb now.


Turns out I just needed to tick the "This file will be played in the browser" checkbox.    ðŸ˜…



wow, I feel dumb... truns out I just needed to click the "this game will be played in the browser" checkbox.