title: Javascript Dynamic Module Import Returns Undefined
body: <p>I am attempting to utilize the <a href="https://developers.google.com/web/updates/2017/11/dynamic-import" rel="nofollow noreferrer">new JavaScript dynamic import syntax</a> to load ES6 modules. Each module exports a single class. However, I cannot access the default exports of my modules. In the inspector I can see that my module was imported and contains the expected class, however cannot be accessed using the <code>default</code> attribute.</p>
  
  <p>I have attempted to run my code on Firefox 67 and Chrome 74, which both produced the same results. I have also tried using static imports which work correctly with some minor adaptation to my code.</p>
  
  <p>My code attempts to import three modules: <em>home</em>, <em>visitors</em> and <em>statistics</em>. Each contains a class named <em>HomeView</em>, <em>VisitorView</em> and <em>StatisticsView</em> respectively.</p>
  
  <pre><code>const module_names = [
    'home',
    'visitor',
    'statistics',
  ];
  
  const module_promises = 
    module_names.map(name =&gt; import(`./modules/${name}.js`));
  
  const module_instances = Promise.all(module_promises)
    .then(module =&gt; new module.default());
  </code></pre>
  
  <p>However this results in the message <em>"TypeError: module.default is not a constructor"</em>. I attempted to use it as a function, but similar error. Finally I tried printing the <code>default</code> attribute and found it to be undefined.</p>
  
  <pre><code>const module_instances = Promise.all(module_promises)
    .then(module =&gt; console.log(module.default)); // undefined
  </code></pre>
  
  <p>I was expecting to create a list of instantiated class objects. Provided that inspecting the log of my <code>module_promises</code> variable (screenshot below) shows the proper class stored under the <code>default</code> attribute, I cannot see what the problem might be.</p>
  
  <p><img src="https://i.imgur.com/f110mDH.png" alt="Chrome inspector screenshot"></p>