lundegaard / gatsby-plugin-pdf

Gatsby plugin that is able generate PDFs out of your gatsby web pages
MIT License
9 stars 8 forks source link

Build fails on Gatsby Cloud + other CD solutions #2

Open AndyAyrey opened 3 years ago

AndyAyrey commented 3 years ago

The Puppeteer dependency introduces some sensitivities to the deployment environment. Attempting to build on Gatsby Cloud or Digital Ocean generates:

/usr/src/app/www/node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome: error while loading shared libraries: libatk-bridge-2.0.so.0: cannot open shared object file: No such file or directory

Presumption is that these environments are containerised and lack the modules that Puppeteer depends on

Do you see any way around this, or is the best solution just to roll-your-own CI solution with a VPS?

Carlosf96 commented 3 years ago

Any help on this one ?

AndyAyrey commented 3 years ago

@Carlosf96 I've worked around it by using a containerized Github Action to build PDFs as part of the Gatsby Cloud deployment sequence. It's not the most elegant but it works ok: https://github.com/Zygar/pagedjs-cli-github-action

RenderCoder commented 2 years ago

I use this docker image for CI: satantime/puppeteer-node:16

but still has other problem:

error "gatsby-plugin-pdf" threw an error while running the onPostBuild lifecycle:
[96](https://git.corp.acflow.com/app-internal/protocol-document/-/jobs/2896#L96)Failed to launch the browser process!
[97](https://git.corp.acflow.com/app-internal/protocol-document/-/jobs/2896#L97)[0908/035510.886998:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
[98](https://git.corp.acflow.com/app-internal/protocol-document/-/jobs/2896#L98)TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md