puppeteer install in railway container
zavien1
PROOP

2 years ago

I am trying to run a node script using bun and puppeteer but the container fails to retrieve the chrome executable


283 |             if (this.puppeteer.configuration.browserRevision) {

284 |                 throw new Error(`Tried to find the browser at the configured path (${executablePath}) for revision ${this.puppeteer.browserRevision}, but no executable was found.`);

285 |             }

286 |             switch (this.product) {

287 |                 case 'chrome':

288 |                     throw new Error(`Could not find Chrome (ver. ${this.puppeteer.browserRevision}). This can occur if either\n` +

^

error: Could not find Chrome (ver. 119.0.6045.105). This can occur if either

1. you did not perform an installation before running the script (e.g. `npx puppeteer browsers install chrome`) or

2. your cache path is incorrectly configured (which is: /root/.cache/puppeteer).

For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.

at resolveExecutablePath (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:288:26)

at /app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:113:31

at computeLaunchArguments (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:72:33)

at /app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:79:33

at launch (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:77:17)

at /app/node_modules/puppeteer-extra/dist/index.cjs.js:128:30

at processTicksAndRejections (:61:76)```

10 Replies

zavien1
PROOP

2 years ago

3bcf5308-03ce-40e9-b19a-bff7879f04f7


zavien1
PROOP

2 years ago

Not sure if the chromium instance is being installed elsewhere


zavien1
PROOP

2 years ago

or where it would be inside the railway container


2 years ago

you did not perform an installation before running the script (e.g. `npx puppeteer browsers install chrome`)

zavien1
PROOP

2 years ago

<@539512869780455445> railway should be running the puppeteer install command on build no?


zavien1
PROOP

2 years ago

should I be setting that as the overrided build command


2 years ago

railway runs your code as-is, its up to you to set the needed commands


zavien1
PROOP

2 years ago

got it


2 years ago

you would likely want to set that command in a new build phase


zavien1
PROOP

2 years ago

Thank you Brody


Welcome!

Sign in to your Railway account to join the conversation.

Loading...