<p dir="auto">Code Example</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Parent {
    constructor() {
  }
};

class Child extends Parent {
    constructor() {
        super();
    }

    scopedFunctionWithThis = () =&gt; {
        this.name = {};
    }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Parent</span> <span class="pl-kos">{</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">class</span> <span class="pl-v">Child</span> <span class="pl-k">extends</span> <span class="pl-v">Parent</span> <span class="pl-kos">{</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">super</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-c1">scopedFunctionWithThis</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<ol dir="auto">
<li>Save above snippet as <code class="notranslate">a.js</code></li>
<li>Run <code class="notranslate">babel --presets stage-0  a.js</code>,</li>
<li>Error Message: <code class="notranslate">SyntaxError: a.js: 'this' is not allowed before super() (This is an error on an internal node. Probably an internal error)</code></li>
</ol>
<p dir="auto">This is fine on <a href="https://babeljs.io/repl/#?experimental=true&amp;evaluate=true&amp;loose=false&amp;spec=false&amp;code=class%20Parent%20%7B%0A%20%20%20%20constructor%28%29%20%7B%0A%20%20%7D%0A%7D%3B%0A%0Aclass%20Child%20extends%20Parent%20%7B%0A%20%20%20%20constructor%28%29%20%7B%0A%20%20%20%20%20%20%20%20super%28%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20scopedFunctionWithThis%20%3D%20%28%29%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20this.name%20%3D%20%7B%7D%3B%0A%20%20%20%20%7D%0A%7D%0A" rel="nofollow">babel repl</a> however.</p>
<p dir="auto">Environment:</p>
<ul dir="auto">
<li>node: v4.2.1</li>
<li>npm: 2.14.7</li>
<li>Packages: babel-core, es2015, stage0 are installed</li>
</ul>
<blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jgrund/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jgrund">@jgrund</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.2.1</li>
<li><strong>Node version:</strong> 4.2.4</li>
<li><strong>npm version:</strong> 3.4.0</li>
</ul>
<h3 dir="auto">Options</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--plugins transform-es2015-modules-umd"><pre class="notranslate"><code class="notranslate">--plugins transform-es2015-modules-umd
</code></pre></div>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as foo from '../index.js';"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">foo</span> <span class="pl-k">from</span> <span class="pl-s">'../index.js'</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">It appears that importing modules is broken with umd when working with node. The above input code generates:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(function (global, factory) {
  if (typeof define === &quot;function&quot; &amp;&amp; define.amd) {
    define(['exports', '../index.js'], factory);
  } else if (typeof exports !== &quot;undefined&quot;) {
    factory(exports, require('../index.js'));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports, global.index);
    global.tests = mod.exports;
  }
})(this, function (exports) {
  (function (global, factory) {
    if (typeof define === &quot;function&quot; &amp;&amp; define.amd) {
      define(['../index.js'], factory);
    } else if (typeof exports !== &quot;undefined&quot;) {
      factory();
    } else {
      var mod = {
        exports: {}
      };
      factory(global.index);
      global.tests = mod.exports;
    }
  })(this, function (_index) {
    var foo = _interopRequireWildcard(_index);

    function _interopRequireWildcard(obj) {
      if (obj &amp;&amp; obj.__esModule) {
        return obj;
      } else {
        var newObj = {};

        if (obj != null) {
          for (var key in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
          }
        }

        newObj.default = obj;
        return newObj;
      }
    }
  });
});"><pre class="notranslate"><code class="notranslate">(function (global, factory) {
  if (typeof define === "function" &amp;&amp; define.amd) {
    define(['exports', '../index.js'], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports, require('../index.js'));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports, global.index);
    global.tests = mod.exports;
  }
})(this, function (exports) {
  (function (global, factory) {
    if (typeof define === "function" &amp;&amp; define.amd) {
      define(['../index.js'], factory);
    } else if (typeof exports !== "undefined") {
      factory();
    } else {
      var mod = {
        exports: {}
      };
      factory(global.index);
      global.tests = mod.exports;
    }
  })(this, function (_index) {
    var foo = _interopRequireWildcard(_index);

    function _interopRequireWildcard(obj) {
      if (obj &amp;&amp; obj.__esModule) {
        return obj;
      } else {
        var newObj = {};

        if (obj != null) {
          for (var key in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
          }
        }

        newObj.default = obj;
        return newObj;
      }
    }
  });
});
</code></pre></div>
<p dir="auto">It seems like the require('../index.js') up top is never passed through to the inner calls. Because of this we end up with an object literal with an undefined default property.</p>