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.56k stars 545 forks source link

Received the exit code '255' #415

Open AlessandroAnnini opened 6 years ago

AlessandroAnnini commented 6 years ago

Hi I am using this script inside a folder of a create-react-app project because i need it there in order to use Netlify function (like aws lambda).

I am using options like this because otherwise it won't find pdf_a4_portrait.js:

const options = {
  script: './../../node_modules/html-pdf/lib/scripts/pdf_a4_portrait.js',
  format: 'A4'
};

but still i have this error:

Error: html-pdf: Received the exit code '255'
Can't open '../../node_modules/html-pdf/lib/scripts/pdf_a4_portrait.js'

    at ChildProcess.respond (/Users/sunrising/Documents/Projects/testproject/lambda/htmlToPdfBlob.js:25177:31)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

Is there any solution?

366 didn't help

estebanmh95 commented 2 years ago

Hi. Did you solve this issue? Where did you add the options object? Thanks