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

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.

Here is the excerpt of my code.

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

            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?

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

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:

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