2017-06-14 43 views
0

我試圖創建一個使用jsreport STUDIO的報告,但我得到了像下面的錯誤如何將「*」設置爲allowedModules以啓用jsreport腳本文件中的所有內容?

Error occured - Error during rendering report: 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 Stak - 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

誰能告訴我在哪裏可以找到的配置文件更新allowedModules?

回答

0

https://jsreport.net/learn/configuration

jsreport merges configuration from file, environment variables, command line arguments and also directly from the application code. The configuration file needs to be stored at the root of the application with the name prod.config.json. There should be already pre created for you the default one.

應該有dev|prod.config.json在您的應用程序根目錄如果您是普通安裝。您應該編輯它並添加所需的選項。如果在node.js應用程序中使用jsreport,則應通過調用中的選項對象傳遞此選項require('jsreport')({scripts: { ... } })

+0

嗯,我會做到這一點。謝謝@ Jan Blaha – Purushoth

0

我已更改dev.config.json文件。它工作正常

"scripts": { 
"allowedModules": ["request"], 
"timeout": 60000 
}, 
相關問題