# AdvancedDynamicTexture.parseFromUrlAsync() doesn't work on server?

**URL:** <https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236>\
**Category:** Questions\
**Tags:** gui, gui-editor\
**Created:** [September 5, 2024, 3:28pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236 "2024-09-05T15:28:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClementSXD](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@ClementSXD](https://forum.babylonjs.com/u/ClementSXD)\
**Post date:** [September 5, 2024, 3:28pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236/1 "2024-09-05T15:28:09Z")

</div>

Hi everyone,

I have made a gui layout using the online GUI Editor and saved it as a JSON file for my project. In my script, I simply use the AdvancedDynamicTexture.parseFromURLAsync() method to convert it to UI elements.

On my localhost, the method runs fine, but when deploying it to the server, the script cannot find the file at the location I provided. I don’t know what’s different after pushing the files online, I also use JSONs for localization and it works fine there. Saving the UI to a snipper server and then using parseFromSnipperAsync() works, but I would prefer to use a JSON to better keep track of my layouts. Any ideas for what’s wrong?

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [September 5, 2024, 4:47pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236/2 "2024-09-05T16:47:13Z")

</div>

> [@ClementSXD](#):
>
> when deploying it to the server, the script cannot find the file at the location I provided.

Sometimes it may happen because of some bundler settings which don’t suit your server settings, often it is related to relative URLs.  
So check if the JSON file is there, and if it is there why it’s URL is wrong.  
See this thread, for example - removing extra slash in config solved the build problem: [Project setup using Vite with CI/CD on GitHub Actions - #7 by labris](https://forum.babylonjs.com/t/project-setup-using-vite-with-ci-cd-on-github-actions/20337/7)

---

<div class="post-metadata">

**Author:** ![ClementSXD](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@ClementSXD](https://forum.babylonjs.com/u/ClementSXD)\
**Post date:** [September 6, 2024, 1:04pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236/3 "2024-09-06T13:04:46Z")

</div>

Hi, thank you for your time. I’m using webpack to build my project, not Vite. I don’t really know if it changes much of anything, I’m not well versed in web development. I tried your solution in my webpack.config.js but it didn’t work.

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [September 6, 2024, 1:49pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236/4 "2024-09-06T13:49:54Z")

</div>

For webpack try to import your JSON with Node material first:

```auto
import yourJSON from "SomeFolder/fire.json";

```

Then parse the imported, for example:

```auto
      const nodeMaterial = NodeMaterial.Parse(
        yourJSON,
        scene
      );

```

---

<div class="post-metadata">

**Author:** ![ClementSXD](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@ClementSXD](https://forum.babylonjs.com/u/ClementSXD)\
**Post date:** [September 6, 2024, 2:10pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236/5 "2024-09-06T14:10:00Z")

</div>

The NodeMaterial.Parse() throws an exception: “source.blocks is undefined”. I guess it doesn’t accept a JSON file? Sorry for not being more helpful, I’m still new to web development.

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [September 6, 2024, 3:37pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236/6 "2024-09-06T15:37:41Z")

</div>

Did you import your JSON file?

---

<div class="post-metadata">

**Author:** ![ClementSXD](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@ClementSXD](https://forum.babylonjs.com/u/ClementSXD)\
**Post date:** [September 9, 2024, 7:32am UTC](https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236/7 "2024-09-09T07:32:53Z")

</div>

Hello, thank you for your time. Yes, I imported the JSON and passed it to the method as you showed me, but peeking inside the parse method reveals it couldn’t find the ‘source.blocks’ property inside the parse method. I’m not familiar with this method, so I can’t help much.

---

<div class="post-metadata">

**Author:** ![ClementSXD](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@ClementSXD](https://forum.babylonjs.com/u/ClementSXD)\
**Post date:** [September 9, 2024, 10:26am UTC](https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236/8 "2024-09-09T10:26:34Z")

</div>

Solving my own topic: Inside my web.config file, I added the mime type definitions for .mp4 and .json files, as I assumed they would be accepted by default in firefox. I found it weird at first because I already tried that and it didn’t work, so I suppose it was just a typo. But I can now import my UI layouts and read videos just fine.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [September 9, 2024, 1:40pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-parsefromurlasync-doesnt-work-on-server/53236/9 "2024-09-09T13:40:54Z")

</div>

thanks for sharing the solution!
