Hi.
I suppose, I got a main point)
Many thanks for help =)
Posts made by Павло Мацібох
-
RE: Can not find jsreport-proxy module
-
RE: Can not find jsreport-proxy module
Sorry for probably such obvious questions =)
Now I'm tried do like this:instance.use(require('jsreport-pdf-utils')());
instance.use(require('jsreport-handlebars')());
instance.use(require('jsreport-chrome-pdf')());
instance.use(require('jsreport-scripts')());
await instance.init();
if (this.initializedInstance) {
this.instance.beforeRenderListeners.add("listener", (req: any, res: any) => this.beforeRender.call(this, req, res));
this.instance.renderErrorListeners.add("listener", this.renderError);
}
private beforeRender(req: any, res: any) {
console.log('\n\n\n beforeRender LOG \n\n\n');
const jsreport = require('jsreport-proxy'); <-- here an error
}And I still get error "Cannot find module 'jsreport-proxy'"
Probably I don't understand how to use jsreport-scripts ?
-
RE: Can not find jsreport-proxy module
Sorry, but I still can't understand: should I require jsreport-proxy only inside initialized jsreport instance?
-
RE: Can not find jsreport-proxy module
Hi, sure:
private async initializeInstance(): Promise<any> {
try {
/eslint-disable /
const instance = require("jsreport-core")({
httpPort: 3000,
reportTimeout: 180000,
extensions: {
"xlsx": xlsxExtension,
"chrome-pdf": chromePdfExtension,
"html-to-text": htmlToTextExtension,
express: {
inputRequestLimit: "1000mb"
},
assets: {
allowedFiles: "/.",
searchOnDiskIfNotFoundInStore: false,
publicAccessEnabled: true
}
},
templatingEngines: {
numberOfWorkers: 4,
strategy: "http-server"
},
logger: {
console: {
transport: "console",
level: "error"
}
}
});
instance.use(require('jsreport-pdf-utils')());
instance.use(require('jsreport-handlebars')());
instance.use(require('jsreport-chrome-pdf')());
instance.use(require('jsreport-proxy')({})); <-- HERE IS AN ERROR: Cannot find module 'jsreport-proxy'
await instance.init();
this.instance = instance;
this.initializedInstance = true;
} catch (err) {
throw new Error(err);
}
if (this.initializedInstance) {
this.instance.afterRenderListeners.add("listener", (req: any, res: any) => this.afterRender.call(this, req, res));
this.instance.renderErrorListeners.add("listener", this.renderError);
}
} -
Can not find jsreport-proxy module
Hi
I have tried to use jsreport-proxy for merging my pages, but I got error 'Can't find module'
For creating pdf I use node.js and jsreport-core with packages:
jsreport-pdf-utils, jsreport-handlebars, jsreport-chrome-pdf, jsreport-scripts
Do I need some additional packages for possibility to use module jsreport-proxy?
Thanks for help) -
RE: Can not find jsreport-proxy module
Hi @jan_blaha
I have tried to use jsreport-proxy, but I got the same error as @赵大程
For creating pdf I use node.js and jsreport-core with packages:
jsreport-pdf-utils, jsreport-handlebars, jsreport-chrome-pdf, jsreport-scripts
Do I need some additional packages for possibility to use module jsreport-proxy?
Thanks for help)