# Regardless Scripts all assets are getting downloaded from Server

**URL:** <https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613>\
**Category:** Help & Support\
**Tags:** publishing\
**Created:** [November 29, 2022, 5:08pm UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613 "2022-11-29T17:08:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![PlaycanvasDeveloper](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/p/ecccb3/32.png) [@PlaycanvasDeveloper](https://forum.playcanvas.com/u/PlaycanvasDeveloper)\
**Post date:** [November 29, 2022, 5:08pm UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/1 "2022-11-29T17:08:16Z")

</div>

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

 ![image](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/a/1/a12e6c110ba8804ac8e988077db7db2f300d26ec.png)

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [November 29, 2022, 5:45pm UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/2 "2022-11-29T17:45:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![PlaycanvasDeveloper](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/p/ecccb3/32.png) [@PlaycanvasDeveloper](https://forum.playcanvas.com/u/PlaycanvasDeveloper)\
**Post date:** [November 29, 2022, 5:52pm UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/3 "2022-11-29T17:52:40Z")

</div>

I

> [@you star](#):
>
> In the Editor project, is SpawnerManager.js set to preload?

Yes SpawnManager.js is enabled with preload option

> [@yaustar](#):
>
> Does the file SpawnerManager.js exist on the server?

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

> [@yaustar](#):
>
> What code is asking for SpawnerManager to be loaded by the project?

Like randomly enabling entities and changing their textures in runtime

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [November 29, 2022, 6:03pm UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/4 "2022-11-29T18:03:34Z")

</div>

> [@PlaycanvasDeveloper](#):
>
> Yes SpawnManager.js is enabled with preload option

In which case, the code would be concatenated in `__game-scripts.js`and 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.

---

<div class="post-metadata">

**Author:** ![PlaycanvasDeveloper](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/p/ecccb3/32.png) [@PlaycanvasDeveloper](https://forum.playcanvas.com/u/PlaycanvasDeveloper)\
**Post date:** [November 29, 2022, 6:26pm UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/5 "2022-11-29T18:26:39Z")

</div>

> [@yaustar](#):
>
> n which case, the code would be concatenated in `__game-scripts.js`and the individual script file would not exist in the build.

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.

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [November 29, 2022, 9:56pm UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/6 "2022-11-29T21:56:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PlaycanvasDeveloper](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/p/ecccb3/32.png) [@PlaycanvasDeveloper](https://forum.playcanvas.com/u/PlaycanvasDeveloper)\
**Post date:** [November 30, 2022, 2:58pm UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/7 "2022-11-30T14:58:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [November 30, 2022, 5:41pm UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/8 "2022-11-30T17:41:11Z")

</div>

> [@PlaycanvasDeveloper](#):
>
> 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.

> [@PlaycanvasDeveloper](#):
>
> 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

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.

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [November 30, 2022, 5:45pm UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/9 "2022-11-30T17:45:19Z")

</div>

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](mailto:support@playcanvas.com) with your timezone and availability and we can setup up a time to go through this.

---

<div class="post-metadata">

**Author:** ![PlaycanvasDeveloper](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/p/ecccb3/32.png) [@PlaycanvasDeveloper](https://forum.playcanvas.com/u/PlaycanvasDeveloper)\
**Post date:** [December 1, 2022, 1:55am UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/10 "2022-12-01T01:55:39Z")

</div>

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 .

---

<div class="post-metadata">

**Author:** ![PlaycanvasDeveloper](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/p/ecccb3/32.png) [@PlaycanvasDeveloper](https://forum.playcanvas.com/u/PlaycanvasDeveloper)\
**Post date:** [December 1, 2022, 1:58am UTC](https://forum.playcanvas.com/t/regardless-scripts-all-assets-are-getting-downloaded-from-server/28613/11 "2022-12-01T01:58:35Z")

</div>

> [@yaustar](#):
>
> the loading script order in project settings have changed then yes it could be different otherwise if it’s freshly forked, then no.

Ok sure ,I will check that

> [@yaustar](#):
>
> a bit confused on your workflow as it sounds like you are combining two project exports which is not recommended

I am not combining different output build files.
