puppeteer install in railway container

zavien1HOBBY

a year ago

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

```$ bun src/index.ts

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)```

0 Replies

zavien1HOBBY

a year ago

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


zavien1HOBBY

a year ago

Not sure if the chromium instance is being installed elsewhere


zavien1HOBBY

a year ago

or where it would be inside the railway container


a year ago

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

zavien1HOBBY

a year ago

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


zavien1HOBBY

a year ago

should I be setting that as the overrided build command


a year ago

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


zavien1HOBBY

a year ago

got it


a year ago

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


zavien1HOBBY

a year ago

Thank you Brody


puppeteer install in railway container - Railway Help Station