Skip to content

Instantly share code, notes, and snippets.

@mk
Created November 25, 2022 08:00
Show Gist options
  • Save mk/aec5587913c957be47f1b52ad1c12563 to your computer and use it in GitHub Desktop.
Save mk/aec5587913c957be47f1b52ad1c12563 to your computer and use it in GitHub Desktop.

Revisions

  1. mk revised this gist Nov 25, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion deps.edn
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    {:paths ["."]
    :deps {org.graalvm.js/js {:mvn/version "21.3.2.1"}}}
    :deps {org.graalvm.js/js {:mvn/version "21.3.2.1"}}}
  2. mk created this gist Nov 25, 2022.
    2 changes: 2 additions & 0 deletions deps.edn
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    {:paths ["."]
    :deps {org.graalvm.js/js {:mvn/version "21.3.2.1"}}}
    8 changes: 8 additions & 0 deletions graal_js_repro.clj
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    (ns graal-js-repro)

    (def ^org.graalvm.polyglot.Context$Builder context-builder
    (doto (org.graalvm.polyglot.Context/newBuilder (into-array String ["js"]))
    (.option "js.esm-eval-returns-exports", "true")))

    (defn build-context [_]
    (def ^org.graalvm.polyglot.Context ctx (.build context-builder)))
    73 changes: 73 additions & 0 deletions stacktrace.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,73 @@
    $ clojure -J-Dclojure.main.report=stderr -X graal-js-repro/build-context
    {:clojure.main/message
    "Execution error (IllegalArgumentException) at com.oracle.truffle.polyglot.PolyglotEngineException/illegalArgument (PolyglotEngineException.java:131).\nCould not find option with name js.esm-eval-returns-exports.\n",
    :clojure.main/triage
    {:clojure.error/class java.lang.IllegalArgumentException,
    :clojure.error/line 131,
    :clojure.error/cause
    "Could not find option with name js.esm-eval-returns-exports.",
    :clojure.error/symbol
    com.oracle.truffle.polyglot.PolyglotEngineException/illegalArgument,
    :clojure.error/source "PolyglotEngineException.java",
    :clojure.error/phase :execution},
    :clojure.main/trace
    {:via
    [{:type java.lang.IllegalArgumentException,
    :message
    "Could not find option with name js.esm-eval-returns-exports.",
    :at
    [com.oracle.truffle.polyglot.PolyglotEngineException
    illegalArgument
    "PolyglotEngineException.java"
    131]}],
    :trace
    [[com.oracle.truffle.polyglot.PolyglotEngineException
    illegalArgument
    "PolyglotEngineException.java"
    131]
    [com.oracle.truffle.polyglot.OptionValuesImpl
    failNotFound
    "OptionValuesImpl.java"
    274]
    [com.oracle.truffle.polyglot.PolyglotEngineImpl
    parseOptions
    "PolyglotEngineImpl.java"
    736]
    [com.oracle.truffle.polyglot.PolyglotEngineImpl
    <init>
    "PolyglotEngineImpl.java"
    313]
    [com.oracle.truffle.polyglot.PolyglotImpl
    buildEngine
    "PolyglotImpl.java"
    288]
    [org.graalvm.polyglot.Engine$Builder build "Engine.java" 625]
    [org.graalvm.polyglot.Context$Builder build "Context.java" 1851]
    [graal_js_repro$build_context invokeStatic "graal_js_repro.clj" 8]
    [graal_js_repro$build_context invoke "graal_js_repro.clj" 7]
    [clojure.lang.AFn applyToHelper "AFn.java" 154]
    [clojure.lang.AFn applyTo "AFn.java" 144]
    [clojure.lang.Var applyTo "Var.java" 705]
    [clojure.core$apply invokeStatic "core.clj" 667]
    [clojure.core$apply invoke "core.clj" 662]
    [clojure.run.exec$exec invokeStatic "exec.clj" 48]
    [clojure.run.exec$exec doInvoke "exec.clj" 39]
    [clojure.lang.RestFn invoke "RestFn.java" 423]
    [clojure.run.exec$_main$fn__205 invoke "exec.clj" 180]
    [clojure.run.exec$_main invokeStatic "exec.clj" 176]
    [clojure.run.exec$_main doInvoke "exec.clj" 139]
    [clojure.lang.RestFn applyTo "RestFn.java" 137]
    [clojure.lang.Var applyTo "Var.java" 705]
    [clojure.core$apply invokeStatic "core.clj" 667]
    [clojure.main$main_opt invokeStatic "main.clj" 514]
    [clojure.main$main_opt invoke "main.clj" 510]
    [clojure.main$main invokeStatic "main.clj" 664]
    [clojure.main$main doInvoke "main.clj" 616]
    [clojure.lang.RestFn applyTo "RestFn.java" 137]
    [clojure.lang.Var applyTo "Var.java" 705]
    [clojure.main main "main.java" 40]],
    :cause
    "Could not find option with name js.esm-eval-returns-exports."}}

    Execution error (IllegalArgumentException) at com.oracle.truffle.polyglot.PolyglotEngineException/illegalArgument (PolyglotEngineException.java:131).
    Could not find option with name js.esm-eval-returns-exports.