Render fails from command line

  • You seem to be setting to the template.content path to the template folder.
    The template.content expects path to a raw file with content.
    Perhaps something like data/weeklyFoxiePerformance/content.handlebars could work.
    However the template.content is typically used when you don't have templates persisted by jsreport and you target raw html files (with handlebars inside).

  • ok, gotcha!

    Thanks again, and all the best to you and yours for the holidays!

     - Roger

  • Hi @jan_blaha ... I am moving over to our new report server and trying to run again from the command line, but now getting a different error. Image of the error(s) below. The new server is an Ubuntu box with nothing on it but git, nvm, npm, and jsreports. Can you look at the screen shot and let me know what's happening here? Thanks much, and please let me know if I should ask this in a separate thread - happy to do so.


  • You typically need to install some additional libs if you want to run chrome-pdf on ubuntu. See the installation instructions here

  • Thanks again, @jan_blaha ... will try this. Much appreciated, and Happy New Year.

  • Hi again @jan_blaha ... hope you're having a terrific New Year!

    We are making great progress here! Your link to additional Ubuntu items for installation indeed fixed the problem and the report runs perfectly from the CLI ... thank you for that.

    New issue ... I'm trying to now call the CLI from Node as a child_process and passing it the command line details we have working above. However, I'm getting the following errors trying to do so. Can you help me construct a child_process command that will work here? Everything I've tried is failing.

    Here's my child_process (cp) call, followed by the error.


    As you can see in the error, and fwiw, ${self.resources.globals.paths.appRoot}/ evaluates to /Users/Roger/Dev/nrlx

    Thanks in advance Jan. Always very much appreciated.

  • This looks like the same problem as before.
    The should be the template name or path inside jsreport folder structure. Not an absolute path to the file system directory. In other words, if you start jsreport using jsreport start, you should open the studio and use the name or path you see in the entity tree panel.

    In your case the could work.

  • Good morning Jan, and thanks for the very quick response here. I've actually tried a number of pathing options and none of them are working, including just naming the template as we did from the command line, and none of it seemed to work. That said, I tried it again this morning (as you suggested) on my new server and am now receiving this error, which is indeed progress, and I'm almost certain this is a simple fix.


    Thanks again, @jan_blaha.

    FYI, Studio runs from here, as well as running jsreport render from the command line. This is showing up running the cp.execute() from Node.


    Try to pass the working directory cwd in the options with the path to the jsreport app, where is the config file.

  • NICE!! That worked ...

    cp.exec(xcommand, {cwd:"jsreports"}, function(err,stdout,stderr) { ...

    Thanks again, @jan_blaha ! I hope this is your toughest problem all year :-)

Log in to reply

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