title: Graal.js importing module causes org.graalvm.polyglot.PolyglotException: SyntaxError: Expected an operand but found import
body: <p>I am trying to use experimental ES module support from Grall.js.
  I use following scripts: ES module "lib"</p>
  
  <pre><code>export const sqrt = Math.sqrt;
  export function square(x) {
      return x * x;
  }
  export function diag(x, y) {
      return sqrt(square(x) + square(y));
  }
  </code></pre>
  
  <p>and main script "script"</p>
  
  <pre><code>import { square, diag } from 'lib';
  console.log('square(11)=' + square(11));
  console.log('diag(4,3)=' + diag(4, 3));
  </code></pre>
  
  <p>I use graalvm-ce-19.2.1 and I use Polyglot inside JVM via <a href="https://github.com/graalvm/graaljs/blob/master/docs/user/JavaInterop.md#scriptengine-jsr-223" rel="nofollow noreferrer">JSR 223</a> to run the main script. 
  Instead of trying to load lib from some place on disk it throws:</p>
  
  <pre><code>javax.script.ScriptException: org.graalvm.polyglot.PolyglotException: SyntaxError: script:1:0 Expected an operand but found import
  import { square, diag } from 'lib';
  ^
  script:1:30 Expected ; but found lib
  import { square, diag } from 'lib';
                                ^
          at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:348)
          at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:323)
  </code></pre>
  
  <p>What's wrong?</p>