node-html-pdf icon indicating copy to clipboard operation
node-html-pdf copied to clipboard

Throw error explicitly using the callback instead of failing due to "Cannot read property 'filename' of undefined"

Open omrilit opened this issue 4 years ago • 7 comments
trafficstars

omrilit avatar Aug 18 '21 08:08 omrilit

@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 avatar Nov 20 '21 09:11 jagadeesh93

@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

omrilit avatar Nov 29 '21 10:11 omrilit

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

barakplasma avatar Feb 08 '22 07:02 barakplasma

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 avatar Feb 08 '22 07:02 barakplasma

@barakplasma it would be great if you could write here if it worked for you.

omrilit avatar Feb 08 '22 08:02 omrilit

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.

barakplasma avatar Feb 08 '22 17:02 barakplasma

@omrilit your mileage may vary, but I deployed the fix in #644 to prod, and we haven't had that error since

barakplasma avatar Feb 20 '22 08:02 barakplasma