My project is using puppeteer to generate screenshots of website and also some other endpoints use it for scraping. It works perfectly fine but suddenly it stopped working showing errors below
I tried remaking the screenshot generator from this article from vercel https://vercel.com/guides/deploying-puppeteer-with-nextjs-on-vercel but this one it doesnt work too and showing those errors. What change? or what am I doing wrong cause I literally followed the steps and copy pasted the code there in sample but that one does not work too
Vercel Staff
I've replicated the issue following the blog post, I'll check in with the team to see if we can get this fixed
Vercel Staff
I'm not fully clear as to what changed in our runtime to make this example not work, it could be related to some supply chain security changes to stop installed binaries from executing. I'll continue investigating and if we can restore the functionality of the old way without compromising security I'll push for that, otherwise we'll update the guide with the new solution
In the meantime you can reference (or copy) this example repo for how to provision puppeteer that works today
use a postinstall script in your package.json that zips chromium and puts in the /public directory
Hi guys, I ran into the same persistent issue many have mentioned:
❌ “The input directory /var/task/node_modules/@sparticuz/chromium/bin does not exist.”
After days of testing every suggestion (including @sparticuz/chromium, playwright-core, custom vercel.json configs, and the manual postinstall zip script, this is what finally worked for my production setup on Vercel.
My Stack:
Next.js 16 (App Router)
Supabase (Postgres + RLS multi-tenant setup)
Vercel Functions (Node.js 20 runtime)
puppeteer-core @ latest
@sparticuz/chromium-min @ latest (141.0.0)
Target: Generate PDFs server-side using Puppeteer (not screenshots)
Solution that worked for me:
Install the latest versions npm install puppeteer-core @sparticuz/chromium-min
Works in production on Vercel so no more missing binary errors
Any updates on this issue?
Thank you , I got my (previously working) sparticuz/chromium with puppeteer-core working again, with your postinstall hack. However, this feels really dirty. Are there any alternatives available on Vercel to be able to run chromium/puppeteer to generate screenshots and PDFs in a better and more maintainable way?
I tried your solution too, but I had to make a lot of extra loops to extract the tar-files before Puppeteer would recognize the chromium, and even then it would still cause timeouts.
This topic is closed. It no longer accepts new replies.