I am not getting a return from the render function.. my question is can I enable more logging somehow to see where jsreport is getting hung up? details below:
I am using chrome-aws-lambda to enable running chrome on lambda. I am able to run the example code from this package and it works. Takes about 3 seconds to run.
sample code here:
(async () => {
log.info(`loading chrome `);
const chromium = require('chrome-aws-lambda');
let executablePath = await chromium.executablePath;
log.info(`executable path ... `, executablePath);
let browser = await chromium.puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath,
headless: chromium.headless,
});
log.info(`executable path ... `, chromium.executablePath);
log.info(`new page ... `);
let page = await browser.newPage();
log.info(`new page ... `, page);
await page.goto(event.url || 'https://example.com');
let result = await page.title();
log.info(`result `, result);
})();
I get back:
"log": [
"result ",
"Example Domain"
],
The path for the chromium is /tmp/chromium..
"log": [
"executable path ... ",
"/tmp/chromium"
],
I pass this to jsreport:
const jsreport = require('jsreport-core')({
tasks: {
allowedModules: '*',
strategy: 'in-process'
},
loadConfig: false,
studio: { enabled: false },
allowLocalFilesAccess: true,
dataDirectory: path.join(os.tmpdir(), 'jsreport'),
templatingEngines: { allowedModules: '*' },
extensions: {
"chrome-pdf": {
"launchOptions": {
executablePath: "/tmp/chromium",
"args": ["--no-sandbox"]
}
}
}
});
and I guess it loads since it did not error.. but it never returns from render.
oh.. these are my dependancies. I also pass the flag for pupppeter not to download chrome since it is too large for lambda.. hence using the package
"dependencies": {
"chrome-aws-lambda": "^1.17.1",
"config": "1.21.0",
"handlebars": "^4.1.0",
"handlebars-helpers": "0.10.0",
"handlebars-intl": "1.1.2",
"jsonwebtoken": "8.2.1",
"jsreport-chrome-pdf": "^1.4.0",
"jsreport-core": "^2.4.3",
"jsreport-handlebars": "^2.0.1",
"jsreport-html-to-xlsx": "^2.3.0",
"jsreport-xlsx": "^2.0.10",
"mongoose": "4.13.17",
"puppeteer": "1.12.2",
"regenerator-runtime": "^0.13.2",
"upgrade": "1.1.0",
"uuid": "3.1.0"
},
any thoughts on where jsreport might be getting stuck?