ENOENT Error with puppeteer when creating .pdf
I am using puppeteer in my express server app to create a .pdf file from a html template. It works fine locally and throws this error when I upload the server app to railway.
(from railway deploy log):
This is the code that I'm using in my node express server:
The
console.log('tempPath', tempPath)
is the first line in the error message. The next line (pdf creation) seems to create the error.:
Help would be much appreciated.Solution:Jump to solution
if you dont have anything in it and checked it into git its likely git ignored that dir. you may need to add a
.gitkeep
in that directory with no contents or maybe try using /tmp/
instead of a local temp directory?7 Replies
Project ID:
N/A
N/A
does temp exist?
Solution
if you dont have anything in it and checked it into git its likely git ignored that dir. you may need to add a
.gitkeep
in that directory with no contents or maybe try using /tmp/
instead of a local temp directory?Wow, you're 100% correct. It didn't exist in my git repo because it's empty. Never realized git would ignore empty folders. Thanks a lot @ImLunaHey !
remember to mark this as correct 🙂
Done, cheers! 😄