Regardless Scripts all assets are getting downloaded from Server

Hie forum,
I am facing one strange issue after hosting build on the server I can download all assets except scripts
I am getting a 404 error for scripts in the chrome network tab console.

Note:-
I did my project in the 1.56.0 version and the current version is 1.58.2 so after exporting the build file I used it to replace the Playcanvasminstable.js file

Here is PFA

In the Editor project, is SpawnerManager.js set to preload?

Does the file SpawnerManager.js exist on the server?

What code is asking for SpawnerManager to be loaded by the project?

I

Yes SpawnManager.js is enabled with preload option

I am uploading the whole build project so I think it should be exist

Like randomly enabling entities and changing their textures in runtime

In which case, the code would be concatenated in __game-scripts.jsand the individual script file would not exist in the build.

Without debugging it myself, I can’t really say why you are seeing the behaviour you seeing.

I would go back through the callstack to see which entity/code is causing the load and look more closely on how it’s being setup/trying to download the script asset.

Not an individual file only those files for them I was using before Preloading off option and in runtime I used to get them to download. Still, I was getting errors sometimes after running exported build, So I decided to set all script preloading on In scripts there are some Texture references variable and textures preloading is off. Now what I am doing once textures are downloaded then only enabling the script component of entities.

It sounds like you will nesd someone to look at the project and/or build directly.

Does it work as expected when hosted and published on playcanv.as?

If so, then there is either something with the process of uploading the build to the self hosted server or the server itself.

Hie @yaustar
After working on this issue I found that it’s like a Playcanvas exporting build file issue,
I have two same projects
After exporting the file from one project I get all scripts present in the _game-scripts.js file
but in another build, there are missing scripts present in the _game-scripts.js file so that’s why I am getting errors for those files

is this possible copy of the same project can produce a different _game-scripts.js file?

If the loading script order in project settings have changed then yes it could be different otherwise if it’s freshly forked, then no.

From this the ‘another build’ had preload unticked on the scripts and therefore the script.js files are in the assets folder. And the new build where you got game-script.js had the script assets preload ticked.

I’m a bit confused on your workflow as it sounds like you are combining two project exports which is not recommended unless you fully understand how the exported build is structured.

For example, GUIDs, asset ids, folder paths will all be different. The data in config.json can be very different.

If you have one build where the scripts are not preloaded and try to use another build game-scripts.js, that isn’t going to work because the config.json will have different paths for those scripts and different settings for loading on them too.

My recommendation is to not combine builds and upload a completely new, fresh build.

It sounds like we need to take this to DMs or even a call to get information about the project you are working on as there seem to be specifics to it that we can’t discuss publicly.

Can you send me an email on support@playcanvas.com with your timezone and availability and we can setup up a time to go through this.

I was planning that I will check everything again that I am doing correctly or not , if still i found some different results then sure we will go for further process .

Ok sure ,I will check that

I am not combining different output build files.