Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for browser launch timeout #96

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

jsuchal
Copy link
Contributor

@jsuchal jsuchal commented Nov 25, 2023

For slow hardware (e.g. home assistant running on old Raspberry Pi) the headless browser launch timeouts with error (see below).

This adds and ENV option to override the default 30s limit.

I was unable to test this on the raspberry, but I was able to replicate the behaviour on my machine by setting a very low limit (e.g. 30ms).

Not sure if I found all places where this config should be exposed, but building locally this works.

> [email protected] start
> node index.js

Starting browser...
/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:214
            reject(new Errors_js_1.TimeoutError(`Timed out after ${timeout} ms while trying to connect to the browser! Only Chrome at revision r${preferredRevision} is guaranteed to work.`));
                   ^

TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r901912 is guaranteed to work.
    at Timeout.onTimeout (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:214:20)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

@jsuchal jsuchal marked this pull request as ready for review November 25, 2023 17:27
Copy link
Owner

@sibbl sibbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! Looks perfect and hope it will help RPi users 👍

@sibbl sibbl merged commit 56ef990 into sibbl:main Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants