Puppeteer Deployment Issue
PUPPETEER DEPLOYMENT ISSUES -- I've seen a lot of chatter around various issues deploying Puppeteer, but nothing jumps out as a complete answer or example for deployment of the current versions. I'm seeing the deployment errors, below after setup in
.puppeteerrc.cjs
. I also tried nixpacks.toml
described in various places but have since removed it after looking at a railway PR.
NOTE: We are using Puppeteer for internal URL screenshot / image generation as it's proven most reliable for our requirement.
ERRORS:
@Mafdet Did you ever get your deployment issue solved? If so, any guidance here?44 Replies
Project ID:
d2f8a6b1-6a3d-46dc-9755-43c359214c26
can you send your package.json?
Hi @brody192. The files look like this:
PACKAGE:
USAGE:
what is this file for?
Configuration | Puppeteer
All defaults in Puppeteer can be customized in two ways:
As it's unclear where Railway needs to store the browser (e.g.
~/.cache/puppeteer
), this resolves. that.see what happens when you delete that file
same issue
it's unclear in Railway where this should point.
There's a whole bunch of different posts around this, and also references for Railway based on Heroku
nixpacks
. But there's a Railway PR that seems to fix it, so I removed the nixpack.show me the pr?
oh, boy ..... that's hours ago...... let me see....
GitHub
Support Puppeteer out of the box by JakeCooper · Pull Request #416 ...
This PR adds support for Puppeteer detection
Interestingly, as a test, I was just able to successfully deploy Playwright which also uses a headless browser.
There is something about the caching of the browser in Puppeteer that is not right -- at least that's my suspicion.
okay fine, I'll ask, why do you have 99% of your dependencies as dev dependencies
That's how Qwik is designed.
Highly optimized for JIT execution, "Resumability" model. It's like streamed Typescript.
but a lot of those are definitely not dependencies that are only used during development
True, the optmization process of Qwik resolves this when it build the produciton version.
Qwik
Framework reimagined for the edge! - Qwik
No hydration, auto lazy-loading, edge-optimized, and fun 🎉!
GitHub
GitHub - BuilderIO/qwik: Instant-loading web apps, without effort
Instant-loading web apps, without effort. Contribute to BuilderIO/qwik development by creating an account on GitHub.
We have production-grade Qwik apps running quite successfully on Railway.
the puppeteer dependency is supposed to install chrome, any idea why it isn't?
I think I should mention, I'm not a JavaScript developer
That's exactly what a couple of us are digging around for today. Why it's not.... and the current suspicion is the cache path.
I'm going to ping someone in the morning and get their opinion too.
I've seen people use puppeteer without issues, without any configuration
I'd just like to see a current (working) example of Puppeteer on Railway using the current versions.
they've never touched the cache directory
Indeed.
I've also seen some comments that people have rolled back to an old version of Puppeterr on Railway.
If you recall anybody, or know of a working example with current releases, please let me know. I can reverse engineer from there.
ill throw my puppeteer test app on railway right now
pnpm up --latest
what
Puppeteer v20.7.2
my test is using 19.7.1
i will try that, then i will update
19 should be after their transision ... interesting
yeah, please throw it up. and if you have a working repo, please share it, plus any configs for Railway (e.g. essential env vars for any paths if required).
no configs should be needed, but i am throwing it up
good start
no issues with 20.7.2
That's good news. Can you share the repo?
dont have a repo
i give zip
sure, that works.
7z close enough
got it -- simple simple simple.
thank you.
let me look at this tomorrow and try to triangulate what's going on with my deployment not finding chrome.
Thank you @brody192! 🙏
sounds good, i blame pnpm
Hahahaha.... maybe!
vite
nothing ever good comes from going against the grain
or one of many other popcicle sticks and bubble gum holding the digital world together.
I've moved over to PlayWright for snapshots and it's working perfectly.
I did have to add a
"postinstall": "npx playwright install"
script to resolve the missing chromium browser. It could be the case that Puppeteer requires a similar but different postinstall
step.
Thanks for your help @brody192.
I am marking this solved, but if anybody else wishes to continue the puppeteer deployment conversation, please feel free.glad you've solved it, super odd why puppeteer wasn't installing chrome for you but was for me