We are getting the following error with NodeJS proxy on Private Cloud version 4.17.01. I am using the request and response modules. The same NodeJS code works in my Public Cloud trial org.
{ "fault": { "faultstring":"Script node executed prematurely: syntax error\nsyntax error\n at module.js:439\n at module.js:474\n at module.js:356\n at module.js:312\n at module.js:497\n at startup (trireme.js:142)\n at trireme.js:923\n", "detail":{ "errorcode":"scripts.node.runtime.ScriptExitedError" } } }
Can you help how to debug this issue ?
Solved! Go to Solution.
org.mozilla.javascript.EvaluatorException: syntax error (/organization/environment/api/index.js#22) at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:77) ~[rhino-1.7.7.1.jar:1.7.7.1] at org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:64) ~[rhino-1.7.7.1.jar:1.7.7.1] at org.mozilla.javascript.Parser.addError(Parser.java:188) ~[rhino-1.7.7.1.jar:1.7.7.1] at org.mozilla.javascript.Parser.addError(Parser.java:166) ~[rhino-1.7.7.1.jar:1.7.7.1] ...
}, (error, response, body) => {
}, function(error, response, body) {
With this change, I was able to resolve the error.
org.mozilla.javascript.EvaluatorException: syntax error (/organization/environment/api/index.js#22) at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:77) ~[rhino-1.7.7.1.jar:1.7.7.1] at org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:64) ~[rhino-1.7.7.1.jar:1.7.7.1] at org.mozilla.javascript.Parser.addError(Parser.java:188) ~[rhino-1.7.7.1.jar:1.7.7.1] at org.mozilla.javascript.Parser.addError(Parser.java:166) ~[rhino-1.7.7.1.jar:1.7.7.1] ...
}, (error, response, body) => {
}, function(error, response, body) {
With this change, I was able to resolve the error.
As far as i know, arrow functions are not supported on Private Cloud yet. They are a part of ES6 and we are still at ES5