Respected Contributor.
Respected Contributor.

(LR) Support Tip: Getting error when running web_js_run

The error message is as below

ReferenceError: require is not defined      [MsgId: MERR-26000]
Action.c(4): Error -35051: Failed to run the JavaScript code      [MsgId: MERR-35051]

The JS file contains require function, which comes from Node.js.

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine, however, web_js_run is using a different JS engine, so web_js_run can't support Node.js, alternatively, we can use JavaScript language in web http/html protocol and use lr.require to load JS file, it's similar with Node.js’ require. 


Labels (1)
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.