title: reactjs dynamic import with constant path variable
body: <p>I faced with a weird problem while using reactjs dynamic import. Let's say I have a component which it's name is <code>ComponentA</code> and it's path is like <code>myComponents/ComponentA</code>. Now when I dynamically import it like the following code, it would work well:</p>
  
  <pre><code>Promise.all(
          [
              import('myComponents/ComponentA'),
              // other imports
          ]
      ).then(....);
  </code></pre>
  
  <p>But if I define my component path in a constant variable like the following :</p>
  
  <pre><code>//before definition of my current component
  const PATH = 'myComponents/ComponentA';
  .
  .
  .
  // some where in my component class
  Promise.all(
      [
          import(PATH),
          // other imports
      ]
  ).then(....);
  </code></pre>
  
  <p>it would give me an error like this: </p>
  
  <blockquote>
    <p>Error: Cannot find module 'myComponents/ComponentA'.</p>
  </blockquote>
  
  <p>And some times if I just add an empty string to my <code>PATH</code> variable would solve the problem and some times it doesn't. </p>
  
  <pre><code>//before definition of my current component
  const PATH = 'myComponents/ComponentA';
  .
  .
  .
  // some where in my component class
  Promise.all(
      [
         import(''+PATH), // some times by adding empty string, problem would be solved
         // other imports
      ]
   ).then(....);
  </code></pre>
  
  <p>any idea about what is going on would be appreciated.</p>