Ah, that's very helpful to know. Normally I'm not the one who sets up these things for my team and I wasn't the one who set us up originally, but I really should be able to handle it.. I will work on my devops-type knowledge. Going through things like this is definitely helpful for my learning! As you can tell, I'm kind of a noob haha. I greatly appreciate the explanations :)
Posts made by arzietlow
-
RE: Script execution causing error during render ("Cannot read property 'forEach' of undefined")
-
RE: Script execution causing error during render ("Cannot read property 'forEach' of undefined")
You're totally right. I noticed right away after installing jsreport-core that it kept the previous version. I will give that a try, thank you so much!
-
RE: Script execution causing error during render ("Cannot read property 'forEach' of undefined")
Hey Jan,
Thank you for your help.. I have updated to the latest version on our ec2 instance. But now I'm having a strange problem. I did npm uninstall before reinstalling to get to version 2.2.0, and I've verified that jsreport and jsreport-core are both showing the correct version. However, running "jsreport start" gives the following output:
[ec2-user@ip-x-x-x-x jsreportapp]$ jsreport start configFile=jsreport.config.json 2018-12-04T22:56:38.319Z - info: Initializing jsreport@2.2.0 in development mode using configuration file: none 2018-12-04T22:56:38.322Z - info: Searching for available extensions in /home/ec2-user/jsreportapp/node_modules/jsreport/ 2018-12-04T22:56:38.377Z - info: Extensions location cache contains up to date information, skipping crawling in /home/ec2-user/jsreportapp/node_modules/jsreport/ 2018-12-04T22:56:38.378Z - info: Found 0 extensions 2018-12-04T22:56:38.379Z - debug: Writing extension locations cache to /tmp/jsreport/core/locations.json 2018-12-04T22:56:38.380Z - debug: Discovered 0 extensions 2018-12-04T22:56:38.386Z - info: Setting process based strategy for rendering. Please visit http://jsreport.net/learn/configuration for information how to get more performance. 2018-12-04T22:56:38.414Z - info: reporter initialized
I have no idea why it appears to be starting without using the config file. The config file itself has correct contents. I've also tried without specifying the config file directly. Jsreport still does not appear as a process after saying "reporter initialized" and I can run "jsreport start" many times without getting any error messages, because the server is not actually started. I'm at a loss once more. Any chance you've got another solution for this? I'll keep working at it and update you if I can figure out what is happening.
-
RE: Script execution causing error during render ("Cannot read property 'forEach' of undefined")
Hey Jan! The version is 2.1.1. I'm guessing we should probably update to 2.2.0 ..... I'm not sure why we weren't on the latest version.
-
Script execution causing error during render ("Cannot read property 'forEach' of undefined")
Hey again,
I'm unable to pinpoint the exact cause of this problem or replicate it at will, so I'm hoping I can get some insight here. It seems to be a result of a template's script execution failing in some way. But I'm not sure, to say the least. I saw a post was made on here with a similar query but it was unanswered.
Here is the code from within the jsreport-core module itself that the error refers to:
const engineRes = await reporter.executeScript({ template: request.template, data: request.data, engine: request.template.pathToEngine, safeSandboxPath: reporter.options.templatingEngines.safeSandboxPath, appDirectory: reporter.options.appDirectory, rootDirectory: reporter.options.rootDirectory, parentModuleDirectory: reporter.options.parentModuleDirectory, templatingEngines: reporter.options.templatingEngines }, { execModulePath: pathToEngineScript }, request) //error happens on the following line engineRes.logs.forEach(function (m) { reporter.logger[m.level](m.message, {...request, timestamp: m.timestamp}) })
Again, any help is greatly appreciated :)
-
RE: Switching recipe from html to chrome-pdf in studio loses styling
Thank you! I'm sorry to waste your time with that... You have been very helpful!
-
Switching recipe from html to chrome-pdf in studio loses styling
Hi again,
I feel like I must be missing something pretty obvious here. I have a main parent template that calls a number of children. Everything works nicely and looks good when the parent report is generated using the html recipe. But when it is called with chrome-pdf, the report is generated without bootstrap and other styling elements. Any chance there's a quick solution to this?
Here's the general structure:
<!DOCTYPE html> <html> <head> <script src="{#asset jquery.min.js @encoding=link}"></script> <script src="{#asset bootstrap.js @encoding=link}"></script> <style> {#asset main.css @encoding=utf8} {#asset bootstrap.css @encoding=utf8} {#asset style.css @encoding=utf8} </style> </head> <body> {#child Child1} {#child Child2} {#child Child3} ... {#child ChildN} </body> </html>
Thank you for any help yet again