archimatetool/archi-scripting-plugin

GraalVM does not work with Papa Parse 5.0.2

johmut opened this issue · 3 comments

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)

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.

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