Excel reports in executable Electron app



  • Hello,
    I am trying to configure jsreport in electron app.
    I followed example on https://jsreport.net/blog/pdf-reports-in-electron-app
    I am using html-to-xlsx to generate the excel file.
    But when I try to run my application I am getting following error:
    error while generating or saving report: Error: Error while executing html-to-xlsx recipe. Failed to launch the browser process! spawn C:\dist\win-unpacked\resources\app.asar\node_modules\puppeteer\.local-chromium\win64-800071\chrome-win\chrome.exe ENOENT.

    Any idea why this could be or how to resolve issue?
    Thanks for any help.


  • administrators

    hi! i'm not 100% sure but it seems that the path here C:\dist\win-unpacked\resources\app.asar\node_modules\puppeteer.local-chromium\win64-800071\chrome-win\chrome.exe ENOENT. is wrong, it seems it should be C:\dist\win-unpacked\resources\app.asar\node_modules\puppeteer\.local-chromium\win64-800071\chrome-win\chrome.exe, the difference is puppeteer\.local-chromium. maybe you are setting that path in wrong way, check that this part of code is setting the correct path.

    // get correct path to chrome executable when running on compiled electron app
      process.env.extensions_chromePdf_launchOptions_executablePath = path.join(CWD, chromePath.slice(chromePath.indexOf('node_modules')))
    


  • This is the complete error

    error while generating or saving report: Error: Error while executing html-to-xlsx recipe.
    Failed to launch chrome! spawn C:\Users\pepe\AppData\Local\Programs\contafi\resources\app.asar\node_modules\puppeteer\.local-chromium\win64-706915\chrome-win\chrome.exe ENOENT

    Sorry, I misspelled the previous error


  • administrators

    hmm i still see the wrong path in the error node_modules\puppeteer.local-chromium



  • I forgot to escape the point



  • Failed to launch chrome! spawn C:\Users\pepe\AppData\Local\Programs\contafi\resources\app.asar\node_modules\puppeteer\.local-chromium\win64-706915\chrome-win\chrome.exe ENOENT


  • administrators

    ok, so if this is the path shown in the error then it seems that the path is ok but somehow it is not working, it can be that now in latest electron or electron builder there is a difference on how to make it work, i can try two things:

    • try the steps mentioned in the https://jsreport.net/blog/pdf-reports-in-electron-app with latest electron, and electron build to verify the the steps are still working fine, if i find some issue i can update the post
    • or if you can somehow setup a repository with the minimal code of your app to reproduce the problem i can give it a look and debug why it is now working


  • I have followed the same steps as in the blog https://jsreport.net/blog/pdf-reports-in-electron-app. I have only added the excel rendering using html-to-xlsx


Log in to reply
 

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