graaljs icon indicating copy to clipboard operation
graaljs copied to clipboard

Updated graalvm-ce-java11-22.2.0 could not find option

Open 0xddy opened this issue 1 year ago • 2 comments

val context = Context.newBuilder()
       .allowExperimentalOptions(true)
       .allowPolyglotAccess(PolyglotAccess.ALL)
       .allowHostAccess(HostAccess.ALL)
       .allowAllAccess(true)
       .allowHostClassLoading(true)
       .allowHostClassLookup {
           true
       }

GraalJSScriptEngine.create(null, context)?.apply {
       val bindings = getBindings(ScriptContext.ENGINE_SCOPE)
       bindings["VERSION"] = "1.0"
       eval(
           """
               function run(){
                  return [1,2,3,4]
               }
           """
       )
       // PolyglotMap
       val ret = invokeFunction("run")

       println(ret)
   }

Exception in thread "main" java.lang.IllegalArgumentException: Could not find option with name js.script-engine-global-scope-import.

0xddy avatar Aug 15 '22 10:08 0xddy

Hi, Thank you for reporting this, is that a Java code? could you please provide a complete reproducer code for this issue? preferably in a Github repo I can pull.

oubidar-Abderrahim avatar Aug 19 '22 09:08 oubidar-Abderrahim

@oubidar-Abderrahim it kotlin coding ,It is compatible with Java ,Upgrade the new version. Graalvm sent this error ,Run normally with version 22.1.0

0xddy avatar Aug 25 '22 14:08 0xddy

@oubidar-Abderrahim it kotlin coding ,It is compatible with Java ,Upgrade the new version. Graalvm sent this error ,Run normally with version 22.1.0

Check this manual

Since GraalVM 22.2, the JavaScript support is packaged in a separate GraalVM component. It can be installed with the GraalVM Updater: $GRAALVM/bin/gu install js

JellyBrick avatar Jan 29 '23 10:01 JellyBrick