title: React-planner Threejs doesn't load texture
body: <p>I have installed <a href="https://github.com/cvdlab/react-planner" rel="nofollow noreferrer"><code>react-planner</code></a> that uses three.js as a package into a react app and managed to get it to render etc. The planner uses a catalog that contains several items that have their own respective textures, I have saved this alongside my src folder in the main app as well according to how their demo is set up.</p>
  <p>When loading the app in the react app it doesn't load the textures or any images and leaves the elements without the required textures, instead its a simple gray colour in the case of the wall.</p>
  <p>However when I run the package by itself through its own webpack config it does manage to load all the required textures and files.</p>
  <p>This is the code for the wall:</p>
  <pre><code>import {ElementsFactories} from 'react-planner';
  
  const info = {
    title: 'wall',
    tag: ['wall'],
    description: 'Wall with bricks or painted',
    image: require('./wall.png'),
    visibility: {
      catalog: true,
      layerElementsVisible: true
    }
  };
  
  const textures = {
    bricks: {
      name: 'Bricks',
      uri: require('./textures/bricks.jpg'),
      lengthRepeatScale: 0.01,
      heightRepeatScale: 0.01,
      normal: {
        uri: require('./textures/bricks-normal.jpg'),
        lengthRepeatScale: 0.01,
        heightRepeatScale: 0.01,
        normalScaleX: 0.8,
        normalScaleY: 0.8
      }
    },
  };
  
  export default ElementsFactories.WallFactory('wall', info, textures);
  </code></pre>
  <p>This is the part of my wall-factory-3d.js that I presume takes in the texture and is what I presume responsible for applying the texture to the wall object:</p>
  <pre><code>const applyTexture = (material, texture, length, height) =&gt; {
    let loader = new TextureLoader();
  
    if (texture) {
      material.map = loader.load(texture.uri);
      material.needsUpdate = true;
      material.map.wrapS = RepeatWrapping;
      material.map.wrapT = RepeatWrapping;
      material.map.repeat.set(length * texture.lengthRepeatScale, height * texture.heightRepeatScale);
  
      if (texture.normal) {
        material.normalMap = loader.load(texture.normal.uri);
        material.normalScale = new Vector2(texture.normal.normalScaleX, texture.normal.normalScaleY);
        material.normalMap.wrapS = RepeatWrapping;
        material.normalMap.wrapT = RepeatWrapping;
        material.normalMap.repeat.set(length * texture.normal.lengthRepeatScale, height * texture.normal.heightRepeatScale);
      }
    }
  };
  </code></pre>
  <p>The catalog isn't registering the JPG and the PNG files for the textures nor the elements.</p>
  <p>This is what I see when I run the app using its own webpack
  <a href="https://i.stack.imgur.com/nX99A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nX99A.png" alt="This is what I see when I run the app through its own webpack" /></a></p>
  <p><a href="https://i.stack.imgur.com/0Tnmp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Tnmp.png" alt="The element uses its texture here when the app is running using its webpack" /></a></p>
  <p>And this is what I see when I use it as a package, it is getting the planner-element.js file but not registering the textures or any images from the catalog folder for some reason?
  <a href="https://i.stack.imgur.com/MqfWi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MqfWi.png" alt="This is what I see when I run the app in another react app as a package" /></a></p>
  <p><a href="https://i.stack.imgur.com/zsb4A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zsb4A.png" alt="And finally when I run it as a package it doesn't use the textures from the catalog" /></a></p>
  <p>What should I look for or investigate? The main app is a standard react app, the package is using older webpack and is a class based app that has no maintainers anymore so its not possible for me to get help from them unfortunately.</p>
  <p>I am wondering if it is loading the URL wrong for the textures/images?
  Any pointers would be appreciated, thanks!</p>