allowedModules issue

  • Hi,

    I'm trying to use the request module. I've added the wildcard to the allowedModules section of the config and restarted JSReport:

    "scripts": {
    "allowedModules": ["*"],
    "timeout": 1000000

    But it sill get an error as follows:

    Error: Unsupported module in scripts: request. To enable require on particular module, you need to update the configuration as {"scripts": { "allowedModules": ["request"] } } ... Alternatively you can also set "*" to allowedModules to enable everything
    at _require (C:\jsreport\node_modules\jsreport-scripts\lib\scriptEvalChild.js:44:11)
    at evalmachine.<anonymous>:1:17
    at ContextifyScript.Script.runInContext (vm.js:59:29)
    at ContextifyScript.Script.runInNewContext (vm.js:65:15)
    at Object.runInNewContext (vm.js:135:38)
    at module.exports (C:\jsreport\node_modules\jsreport-scripts\lib\scriptEvalChild.js:123:6)
    at process.<anonymous> (C:\jsreport\node_modules\script-manager\lib\worker-processes.js:48:36)
    at emitTwo (events.js:125:13)
    at process.emit (events.js:213:7)
    at emit (internal/child_process.js:774:12)

    What exactly am I doing wrong here? We're on 1.8.2 and can't upgrade any time soon, by the way.

  • administrators

    you should set "allowedModules": "*", or "allowedModules": ["request"]

  • Oh man, thanks.

Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.