Skip to content

Instantly share code, notes, and snippets.

@mk
Last active November 25, 2022 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mk/52bbfec146d01b56abc83764b35ab1a3 to your computer and use it in GitHub Desktop.
Save mk/52bbfec146d01b56abc83764b35ab1a3 to your computer and use it in GitHub Desktop.
graal.js IllegalArgumentException
{:paths ["."]
:deps {org.graalvm.js/js {:mvn/version "21.3.2.1"}}}
(ns graal-js-repro)
(def ^org.graalvm.polyglot.Context$Builder context-builder
(doto (org.graalvm.polyglot.Context/newBuilder (into-array String ["js"]))
(.allowExperimentalOptions true)
(.option "js.esm-eval-returns-exports", "true")))
(defn build-context [_]
(def ^org.graalvm.polyglot.Context ctx (.build context-builder)))
$ 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment