node-html-pdf
node-html-pdf copied to clipboard
Throw error explicitly using the callback instead of failing due to "Cannot read property 'filename' of undefined"
@omrilit Hii , I am also facing the same issue on the version 3.0.1, Is there any fix for this , Thanks in advance
@omrilit Hii , I am also facing the same issue on the version 3.0.1, Is there any fix for this , Thanks in advance
@jagadeesh93 not that I am aware of. I've just forked the repo and added this PR's content. You can see it at https://github.com/salto-io/node-html-pdf
I have a suspicion that this bug might be caused by phantomjs failing but html-pdf not catching it and counting on there being a file when there isn't one. PR 644 might solve this issue
For a patch in the meanwhile, see https://github.com/marcbachmann/node-html-pdf/pull/644#issuecomment-1032289083 . I'm going to rollout the patch in prod, ping me later if you're interested in whether it solved the issue for me.
@barakplasma it would be great if you could write here if it worked for you.
I haven't deployed to prod yet, so no news. However, I did write a case to recreate this particular bug in my branch which shows that the fix in #644 does prevent the bug we are experiencing in this issue.
@omrilit your mileage may vary, but I deployed the fix in #644 to prod, and we haven't had that error since