title: module.exports give undefined while print module indicates it's not undefined?
body: <p>I'm trying to work with a CommonJs module which exports a variable conditionally based on whether <code>module</code> and <code>module.exports</code> are undefined. The issue I'm currently having is that sometimes when I use <code>import { something } from 'themodule'</code> it gives me undefined <code>something</code>. While looking into the source code, I found the following export conditions:</p>
  <pre><code>if (typeof module !== 'undefined' &amp;&amp; module.exports) {
      module.exports = Prism;
  }
  </code></pre>
  <p>So I added some logs to the file to see whether the condition is satisfied or not via:</p>
  <pre><code>console.log('module: ', module, 'module.exports: ', module.exports)
  if (typeof module !== 'undefined' &amp;&amp; module.exports) {
      console.log('module.exports!')
      module.exports = Prism;
  }
  </code></pre>
  <p>Which however gives me strange output:</p>
  <blockquote>
  <p>module:  { exports: [Getter/Setter] } module.exports:  undefined</p>
  </blockquote>
  <p>As you can see, the <code>module</code> log seem to indicate it has an <code>exports</code> property however when log <code>module.exports</code> separately, it says it's undefined. How is this possible ? Can someone help understand why this check is needed and why sometimes <code>module.exports</code> can be undefined ? Thanks!</p>