Hi,
you get this error because the javascript implementation within OPL is not the same as the one you try to use.
What you could do:
a) Use an external java call within OPL to call your program in javascript
b) Have your external not OPL javascript call the oplrun executable
c) Have some java code do the link, this java code would both call OPL and your javascript code
PS:
do not hesitate to log a wish
regards
#DecisionOptimization#OPLusingCPLEXOptimizer