title: Uncaught SyntaxError: Unexpected token import when import module
body: <p>I have typescript file that will compile to javasript for the browser. It looks as follow:</p>
  <pre><code>/// &lt;reference path=&quot;typings/jquery/jquery.d.ts&quot; /&gt;
  /// &lt;reference path=&quot;typings/jquery-backstretch/jquery-backstretch.d.ts&quot; /&gt;
  /// &lt;reference path=&quot;typings/jquery-semantic/jquery-semantic.d.ts&quot; /&gt;
  import {Validator} from &quot;classes/validator&quot;;
  
  var main = () =&gt; {
    $(&quot;.ui.dropdown&quot;).dropdown();
    $(&quot;.left-half&quot;).backstretch([&quot;../images/lotus.jpg&quot;]);
  
    const val = new Validator();
    val.foo();
  
  };
  
  $(document)
    .ready(() =&gt; {
      main();
    });
  </code></pre>
  <p>The compiled version:</p>
  <pre><code>/// &lt;reference path=&quot;typings/jquery/jquery.d.ts&quot; /&gt;
  /// &lt;reference path=&quot;typings/jquery-backstretch/jquery-backstretch.d.ts&quot; /&gt;
  /// &lt;reference path=&quot;typings/jquery-semantic/jquery-semantic.d.ts&quot; /&gt;
  import {Validator} from &quot;classes/validator&quot;;
  
  var main = () =&gt; {
    $(&quot;.ui.dropdown&quot;).dropdown();
    $(&quot;.left-half&quot;).backstretch([&quot;../images/lotus.jpg&quot;]);
  
    const val = new Validator();
    val.foo();
  
  };
  
  $(document)
    .ready(() =&gt; {
      main();
    });
  </code></pre>
  <p>When I called the website, it shows me following error:</p>
  <p><a href="https://i.stack.imgur.com/1aqUJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1aqUJ.png" alt="enter image description here" /></a></p>
  <p>What is wrong?</p>