Release build can’t find chunk

Hello.

I am making my first game. Its correct runs in dev mode. But, when a build release version, zip it anf upload to server, I see white screen and error in console: “Failed to load resource: the server responded with a status of 404 ()” and my chunks names.

I changed chunks size to 2Mb, but it did’t resolve problem.

Where is problem? Chunk in separate folder, in index.html paths correct.

Best regards

What are the chunk URLs giving not found and what are the actual chunk paths in the build?

This is my zip. I don’t now khow how to show file tree in zip, but be shure: I ziped “assets” folder and index.html to single archive.

And this is error:

The URLs in dist/index.html do look correct if /assets/ is at the domain root. You could run

npx http-server dist -c-1

in your project directory, open a browser for it, and see if the assets load correctly. If they do I would wonder if the assets aren’t uploaded on the remote server.

I think resources don’t load correctly. But why?

There src/ looks wrong. Are you definitively serving from dist/?

For one thing, you’re loading your script like this:

/assets/index-Bkmw7cjb.js

From looking at your screenshot, the assets folder is inside a dist folder. If you start with the slash, the browser will look for the assets folder in the root of your website (it’s not there if you have a dist folder). It looks like the index.html is within the dist folder as well, so you should be able to change it to this:

assets/index-Bkmw7cjb.js

No slash at the front. This will look for the assets folder in the same folder as the index.html.