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

UnhandledPromiseRejectionWarning: TimeoutError: Navigation timeout of 30000 ms exceeded #111

Open
DrHaze opened this issue Jul 29, 2021 · 0 comments

Comments

@DrHaze
Copy link

DrHaze commented Jul 29, 2021

Bug

Exception raised due to timeout when loading pages. This is due to the default 30s timeout when awaiting a page. Currently living in France I'm far away from NZ and with an average internet connection. The startup of the application to the login screen takes more than 30s.
This is probably the same issue as: #107

Welcome to the MIQ Booking Assistance!
A new browser window should appear. Please navigate to "Secure your allocation" page.
(node:1092) UnhandledPromiseRejectionWarning: TimeoutError: Navigation timeout of 30000 ms exceeded
    at C:\Users\x_win\Downloads\MIQ\miq-nz-booking-tools-master\MIQ-Booking-Assistance\node_modules\puppeteer\lib\cjs\puppeteer\common\LifecycleWatcher.js:106:111
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1092) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1092) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

System

Running on Windows 10

Possible solution

To fix the issue on my side, I globally removed the navigation timeout:

        // Use current page
        const page = (await browser.pages())[0];

        await page.setDefaultNavigationTimeout(0); 
        await page.setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36');

I should probably do a merge request for that but I first started by downloading the zip of the repo and editing the file using notepad... Let me know if you want one.

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

No branches or pull requests

1 participant