TimeoutError: Timed out after 30000 ms while trying to connect to Chrome!
See original GitHub issueHello
I try to implement/deploy puppeteer on Google Cloud but I have some issues. What I don’t understand, it worked well 2 days ago. Since then, I have this error:
TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r674921 at Timeout.onTimeout
I ran this command and everything seems fine : DEBUG=* node app.js
Version puppeteer : ^1.19.0 Version Node : v8.11.3
And here the code:
`async function main_screenshot(project_id) { try { const browser = await puppeteer.launch({ headless: true, args: [“–window-size=1440,1000”, “–no-sandbox”, “–disable-setuid-sandbox”, “–disable-gpu”] }); // const browser = await puppeteer.launch({dumpio: true}); const page = await browser.newPage() page.setUserAgent(‘Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36’) page.setViewport({ width: 1440, height: 721 }) console.log(‘entering in screenshot zone’) page.setDefaultNavigationTimeout(30000) await page.goto(‘https://app.slack.com/client/TLW4JE7AA/CLTFQT9GC’) await page.waitFor(3000) await page.type(‘#email’, process.env.SLACK_EMAIL) await page.type(‘#password’, process.env.SLACK_PWD) await page.waitFor(3000) await page.click(‘#signin_btn’) console.log(‘credentials done’) await page.waitFor(3000) console.log(‘so?’) await page.goto(‘https://app.slack.com/client/TLW4JE7AA/CLTFQT9GC’) await page.waitFor(3000) console.log(‘connected to the right environment’) const div = await page.$$(‘.c-message.c-message–light’) var nuwwmber_loop= 0 for (var i = div.length ; i > 0; i–) { var text = await (await div[i - 1].getProperty(‘textContent’)).jsonValue();
if(text.includes(project_id)) {
number_loop = i
break
}
}
// const text = await (await div.getProperty('textContent')).jsonValue();
const shotResult = await div[number_loop-1].screenshot();
console.log(shotResult)
cloudinaryOptions = {
public_id: `${project_id}`
}
const results = await uploadToCloudinary(shotResult, cloudinaryOptions)
console.log(results)
browser.close()
return results
} catch (e) { console.log(e) } }`
Issue Analytics
- State:
- Created 4 years ago
- Reactions:20
- Comments:112
Top GitHub Comments
@mathiasbynens I belive this should be reopened, still a lot of people seem to have this error.
If it helps anyone my issue with was due to the usage of Puppeteer in Google Cloud Function and have it running in the background. I changed the function to respond only after Puppeteer is done and it worked just fine.