marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.55k stars 544 forks source link

I using Pdf-node-creator for generating pdf in my node application, It was working fine in local environment , But in production I get the below Error #665

Open ghost opened 2 years ago

ghost commented 2 years ago

[Error: ENOENT: no such file or directory, open 'C:\tmp\html-pdf-11516.pdf'] { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'C:\tmp\html-pdf-11516.pdf' }

skulas commented 2 years ago

is your production environment also windows? If so, maybe permissions issues on c:\tmp. If this is a docker image, you need to make sure you have write access and a volume attached to it.

ghost commented 2 years ago

yes my production environment is also windows, no there is no temp file in c:/ . Actually I found the answer that in virtual machines we don't have permission to use temp memory so we got this error.

scush989898 commented 1 year ago

i got the same problem on production using heroku. The solution for me was creating a new env var OPENSSL_CONF with value /dev/null.

https://prnt.sc/VaOabzLAXFlO

i added to heroku env vars and it worked for me.

panshak commented 1 year ago

@scush989898 Thank you very much. I struggled with this problem for close to 5 days now. Your solution worked for me

panshak commented 1 year ago

@scush989898 please will you mind to share why this solution fixed the problem?