archimatetool / archi-scripting-plugin

jArchi - Scripting for Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
118 stars 33 forks source link

GraalVM does not work with Papa Parse 5.0.2 #131

Closed johmut closed 3 months ago

johmut commented 3 months ago

Version of jArchi, Operating System

1.6.1 on Windows

Expected Behaviour

Using the "Export to CSV" script on https://gist.github.com/smileham/15c445b17a92bd6f5dc1508e573bcd8a The expected behavior is to generate 2 .csv files for the selected view

Actual Behaviour

After installing the dependency: scripts\lib\paparse.min.js An error produces when the script is run using the GraalVM engine. Using the deprecated NasHorn 6, the script runs fine

Steps to Reproduce the Behaviour (with attached test files/script)

  1. Select a View
  2. Right Click > Scripts > Export to CSV
  3. org.graalvm.polyglot.PolyglotException: ReferenceError: "Papa" is not defined at .:program(Export to CSV.ajs:183) at .:program(:1) at org.graalvm.polyglot.Context.eval(Context.java:399) at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:478) at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:446)
Phillipus commented 3 months ago

Hi, please read this:

https://forum.archimatetool.com/index.php?topic=1502.msg7742#msg7742

You can either make the change suggested there or enable/disable support for CommonJS.

Phillipus commented 3 months ago

Also, see:

https://github.com/archimatetool/archi-scripting-plugin/issues/127

and

https://github.com/archimatetool/archi-scripting-plugin/wiki/Using-Node.js-modules

johmut commented 3 months ago

Oeps, my bad, did search (not long enough, I admit) and did not find.