R
Railway8mo ago
jjm447

Puppeteer could not find Chrome

I'm trying to get puppeteer working on railway but it's having some issues. My package.json and nixpacks are attached. This is my launch code. VITE_CHROME_EXECUTABLE_PATH is just set if i'm local.
let puppeteerConfig = { headless: "new" }
if (getConfig("VITE_CHROME_EXECUTABLE_PATH")) {
puppeteerConfig['defaultViewport'] = null;
puppeteerConfig['executablePath'] = getConfig("VITE_CHROME_EXECUTABLE_PATH");
} else {
// https://github.com/ryannono/Puppeteer-Railway-Buildpack#puppeteer-nixpacks-buildpack
puppeteerConfig['args'] = ['--no-sandbox', '--disable-setuid-sandbox']
puppeteerConfig['ignoreDefaultArgs'] = ['--disable-extensions']
}
const browser = await puppeteer.launch(puppeteerConfig)
let puppeteerConfig = { headless: "new" }
if (getConfig("VITE_CHROME_EXECUTABLE_PATH")) {
puppeteerConfig['defaultViewport'] = null;
puppeteerConfig['executablePath'] = getConfig("VITE_CHROME_EXECUTABLE_PATH");
} else {
// https://github.com/ryannono/Puppeteer-Railway-Buildpack#puppeteer-nixpacks-buildpack
puppeteerConfig['args'] = ['--no-sandbox', '--disable-setuid-sandbox']
puppeteerConfig['ignoreDefaultArgs'] = ['--disable-extensions']
}
const browser = await puppeteer.launch(puppeteerConfig)
Any help greatly appreciated!
9 Replies
Percy
Percy8mo ago
Project ID: 78e4a2e3-df1d-418a-9e20-32b2f40b45f5
jjm447
jjm4478mo ago
Project id is 78e4a2e3-df1d-418a-9e20-32b2f40b45f5
Brody
Brody8mo ago
may I ask what you are using puppeteer for?
jjm447
jjm4478mo ago
Yes, I'm parsing online article information from the dom to help create citations
Brody
Brody8mo ago
do these online articles allow web scraping?
jjm447
jjm4478mo ago
Yeah
Brody
Brody8mo ago
would you mind showing me where they've stated that they allow web scraping? because web scraping / crawling is listed in railways tos, so if the sites you're scraping doesn't allow it, we won't be able to provide support for this usecase
jjm447
jjm4478mo ago
Gotcha makes sense. I'm trying to find some explicit allowance, give me some time
Brody
Brody8mo ago
no worries