puppeteer-pdf icon indicating copy to clipboard operation
puppeteer-pdf copied to clipboard

Invalid Execution Path

Open idrees1378 opened this issue 4 years ago • 3 comments

My app is deployed on Heroku and i have added Heroku Buildpacks for Puppeteer Pdf but when i try to Generate the pdf it says {:error, :invalid_exec_path}

idrees1378 avatar Sep 21 '20 15:09 idrees1378

The file for puppeteer_pdf doesn't exists. You can define it with:

config :puppeteer_pdf, exec_path: "/usr/local/bin/puppeteer-pdf"

speeddragon avatar Sep 24 '20 22:09 speeddragon

I'm not sure if this issue is still being maintained, but I'm running into the same problem. The issue is that the exec_path being specified is not available in our production application's repo (but it is available locally in the same project's directory after running npm install). So we're not seeing this error when we run the test locally, but we are seeing it in our CI test suite on production.

Is making the puppeteer-pdf directory available somewhere in the project repo (for us, on production) the solution? I would think that the puppeteer-pdf directory would already be available somewhere in the production repo after npm install is run.

ddink avatar Apr 18 '22 16:04 ddink

Hi @ddink, I'm not using any project with this library right now and since pdf_generator has an option to use puppeteer I would suggest using that library.

Related to your issue, this error happens when the path isn't found. Can you access the file in the command line giving the same global path to the puppeteer executable? You can better debug this if you print out the path (exec_path) just before the error. There are two cases where it can give this error, here and here.

Not sure why this gives two different errors for the same outcome, but this could be improved to be more specific.

speeddragon avatar Apr 18 '22 20:04 speeddragon