jjm447
jjm447
RRailway
Created by jjm447 on 11/1/2023 in #✋|help
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!
12 replies