# About the error of CORS policy when creating the hdr cube texture

**URL:** <https://forum.babylonjs.com/t/about-the-error-of-cors-policy-when-creating-the-hdr-cube-texture/23447>\
**Category:** Questions\
**Created:** [August 31, 2021, 2:35am UTC](https://forum.babylonjs.com/t/about-the-error-of-cors-policy-when-creating-the-hdr-cube-texture/23447 "2021-08-31T02:35:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kayla\_Man](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kayla_man/32/12636_2.png) [@Kayla\_Man](https://forum.babylonjs.com/u/Kayla_Man)\
**Post date:** [August 31, 2021, 2:35am UTC](https://forum.babylonjs.com/t/about-the-error-of-cors-policy-when-creating-the-hdr-cube-texture/23447/1 "2021-08-31T02:35:07Z")

</div>

Hi guys,  
I try to download some of my old files made with BabylonJs Library and reuse it but faces some error when compiling it with vs code.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/5/25b511527f6b9b867392c204f5508d10f019360a.png)

Here is the excerpt of my code.

```auto
var nrmtexture = new BABYLON.Texture("textures/shirt_normal.png", scene, true, false);
var spectexture = new BABYLON.Texture("textures/shirt_spec.png", scene, true, false);

```

```auto

            myGoodMat.reflectionTexture = new BABYLON.HDRCubeTexture("textures/abandoned_factory_canteen_02_2k.hdr", scene, 218, false, false, false, false);
            myGoodMat.bumpTexture = nrmtexture;
            myGoodMat.specularTexture = spectexture;

            myGoodMat.metallic = 0;
            myGoodMat.roughness = 1;

```

\*\*I already use the relative path for my code, why the error message still pops up and the maps dont show as usual?

---

<div class="post-metadata">

**Author:** ![ynnek](https://avatars.discourse-cdn.com/v4/letter/y/c68b51/32.png) [@ynnek](https://forum.babylonjs.com/u/ynnek)\
**Post date:** [August 31, 2021, 12:01pm UTC](https://forum.babylonjs.com/t/about-the-error-of-cors-policy-when-creating-the-hdr-cube-texture/23447/2 "2021-08-31T12:01:52Z")

</div>

Hi!  
As I know, browsers don’t support access to the local file system for security.  
Maybe you can use services like cloudinary.

---

<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:** [August 31, 2021, 1:14pm UTC](https://forum.babylonjs.com/t/about-the-error-of-cors-policy-when-creating-the-hdr-cube-texture/23447/3 "2021-08-31T13:14:29Z")

</div>

If you are hosting the files locally, try using a local http-server instead of using the file:// protocol.

There are many available, I find npm’s `http-server` to be the simplest (and it does support CORS with a flag).

To install it (and further documentation:

> **[http-server](https://www.npmjs.com/package/http-server)**
>
> A simple zero-configuration command-line http server

This is just one of many. When you server the files publicly make sure you serve them on a server that lets you configure CORS
