Thank you for the information.
We are importing PDFs into the app and generating image previews of them. Later, we will implement PDF generation from web pages.
I tried using the new build system to integrate Puppeteer:
extensions: [
{
name: "puppeteer",
onBuildComplete: async (context: BuildContext, manifest: BuildManifest) => {
if (context.target === "dev") {
return;
}
context.addLayer({
id: "puppeteer",
image: {
instructions: [
`RUN apt-get update && apt-get install curl gnupg -y \
&& curl --location --silent https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install google-chrome-stable -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*`,
],
},
});
},
},
],
The build works, and we can deploy the image. However, when we try to run a task using puppeteer, we encounter the following error:
UnexpectedExitError: Unexpected exit with code -1
at #handleExit (file:///app/Library/Caches/pnpm/dlx/3m6akg4oukkueqcm6tco2nuxhu/191ebcb6ff4-bd3d/node_modules/.pnpm/[email protected]/node_modules/trigger.dev/dist/esm/entryPoints/deploy-run-controller.mjs:11980:20)
at ChildProcess.emit (node:events:519:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12)