# XmlLoader from localhost return 404

**URL:** <https://forum.babylonjs.com/t/xmlloader-from-localhost-return-404/33574>\
**Category:** Questions\
**Created:** [September 1, 2022, 8:44am UTC](https://forum.babylonjs.com/t/xmlloader-from-localhost-return-404/33574 "2022-09-01T08:44:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lior3790](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lior3790/32/26505_2.png) [@lior3790](https://forum.babylonjs.com/u/lior3790)\
**Post date:** [September 1, 2022, 8:44am UTC](https://forum.babylonjs.com/t/xmlloader-from-localhost-return-404/33574/1 "2022-09-01T08:44:36Z")

</div>

Hi All, @RaananW ,  
I’ve been using the great template to create a typescript project on Babylon that @RaananW has created,  
[GitHub - RaananW/babylonjs-webpack-es6: Babylon.js basic scene with typescript, webpack, es6 modules, editorconfig, eslint, hot loading and more. Will even make coffee if you ask nicely.](https://github.com/RaananW/babylonjs-webpack-es6) (should be official IMO),

The problem is when trying to load a local xml file with `XmlLoader....loadLayout("src/layouts/ui_editMesh.xml" ...`  
I keep getting [https://localhost:8080/src/layouts/ui\_editMesh.xml](https://localhost:8080/src/layouts/ui_editMesh.xml) **404 (Not Found)**

I tried adding xml declaration in the externalFileTypes.d.ts file (without understanding too much why 😊 ) but it didn’t help.

Any suggestions would be really appreciated.

---

<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 1, 2022, 9:13am UTC](https://forum.babylonjs.com/t/xmlloader-from-localhost-return-404/33574/2 "2022-09-01T09:13:10Z")

</div>

public files like static xmls or media you don’t want to bundle should sit where index.html sits, which is a public static directory. If you want to bundle this XML you will need to also provide an xml loader in the webpack configuration.  
If it’s too abstract let me know 🙂

---

<div class="post-metadata">

**Author:** ![lior3790](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lior3790/32/26505_2.png) [@lior3790](https://forum.babylonjs.com/u/lior3790)\
**Post date:** [September 1, 2022, 9:27am UTC](https://forum.babylonjs.com/t/xmlloader-from-localhost-return-404/33574/3 "2022-09-01T09:27:14Z")

</div>

Keeping the xml in the public folder should be good enough.

Can you please suggest what configuration needs to be done in the config files in addition to that?

---

<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 1, 2022, 9:30am UTC](https://forum.babylonjs.com/t/xmlloader-from-localhost-return-404/33574/4 "2022-09-01T09:30:25Z")

</div>

in that case there is no need for extra configuration, just put it there. the base of this directory will be served at localhost:8080/

---

<div class="post-metadata">

**Author:** ![lior3790](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lior3790/32/26505_2.png) [@lior3790](https://forum.babylonjs.com/u/lior3790)\
**Post date:** [September 1, 2022, 11:18am UTC](https://forum.babylonjs.com/t/xmlloader-from-localhost-return-404/33574/5 "2022-09-01T11:18:26Z")

</div>

works like a charm, thanks.

I’ll be happy to be referred to additional reading on how to achieve this with the:

> xml loader in the webpack configuration

---

<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 1, 2022, 12:12pm UTC](https://forum.babylonjs.com/t/xmlloader-from-localhost-return-404/33574/6 "2022-09-01T12:12:25Z")

</div>

Here you go:

> **[Asset Management | webpack](https://webpack.js.org/guides/asset-management/#loading-data)**
>
> webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.
