Open agamtheos opened 2 years ago
I update my error like this =
Error: spawn ./node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT
4/18/2022 4:45:55 PM at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)
4/18/2022 4:45:55 PM at onErrorNT (internal/child_process.js:469:16)
4/18/2022 4:45:55 PM at processTicksAndRejections (internal/process/task_queues.js:82:21) {
4/18/2022 4:45:55 PM errno: -2,
4/18/2022 4:45:55 PM code: 'ENOENT',
4/18/2022 4:45:55 PM syscall: 'spawn ./node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs',
4/18/2022 4:45:55 PM path: './node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs',
4/18/2022 4:45:55 PM spawnargs: [
4/18/2022 4:45:55 PM '--local-url-access=false',
4/18/2022 4:45:55 PM '/app/node_modules/html-pdf/lib/scripts/pdf_a4_portrait.js'
4/18/2022 4:45:55 PM ]
4/18/2022 4:45:55 PM}
@agamtheos Hey, I am facing the same issue. Did you find the solution to this problem? Thnx
I was add this code to my Dockerfile and it's work
RUN apk update && apk add --no-cache wget && apk --no-cache add openssl wget && apk add ca-certificates && update-ca-certificates
RUN wget -qO- "https://github.com/dustinblackman/phantomized/releases/download/2.1.1a/dockerized-phantomjs.tar.gz" | tar xz -C / \
&& npm config set user 0 \
&& npm install -g phantomjs-prebuilt
RUN apk add --update ttf-dejavu ttf-droid ttf-freefont ttf-liberation && rm -rf /var/cache/apk/*
RUN echo "" > /tmp/openssl.cnf
@niraj1234567890 you can see in this issue for more detail https://github.com/marcbachmann/node-html-pdf/issues/563#issuecomment-712852134
It was work properly in my local, but when it deploy to the staging server, the buffer result is undefined. And make errors my app. here's my code :
and this is the error log =
How to solve that problem ?