Pages build failing because Puppeteer won't launch.
I'm trying to inline Critical CSS on my page to get that perfect 100 score [Performance] in Lighthouse. I'm using Astro for my site, and the integration
astro-critical-css
helps in doing that.
Since it uses Puppeteer under the hood to do it, I'm getting this error on deployment:
Any idea how to fix it? It didn't work on my Mac locally either. I had to install Rosetta and then it worked.3 Replies
I can get this done right with a GitHub action—I just need to install the missing dependencies in the runner for this to work. But I'm looking for a Cloudflare approach to solving this problem.
For someone who might face this same issue: it's better to run GitHub actions to deploy to Cloudflare pages in this case.
I placed a
script.sh
on the root of the project which conditionally checks for dependencies and installs them if they aren't available on the runner. Then I gave it executable permissions, ran it, built the project files, and used the cloudflare/wrangler-action
to deploy to Pages.
If anyone from the Cloudflare team could help me find a way to do it with just Cloudflare, I'd be forever grateful. 🥹
Here's the .github/workflows/deploy-to-cloudflare.yaml
file in case anyone wants it for reference:
Running into the same issue with the same error, albeit with the
rollup-plugin-critical
package with Vite. Haven't found a workaround or solution yet, and migrating to GHA to get around this seems like an outsize effort in our case. Would appreciate any help! 🙏Hey, sure. No problem. I'll help as much as I can.
Can you answer these questions, so I'll have enough context to help?
* What's your environment?
* What framework/library are you using?
* What is the error you are getting?
* Have you tried googling the error and have some pointers/ideas on what to do?