question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Navigation Timeout Exceeded with page.setRequestInterception(true)

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.8.0
  • Platform / OS version: MacOS 10.13.4 High Sierra
  • URLs (if applicable):
  • Node.js version: 7.6.0
  • Chromium. ~/node_modules/puppeteer/.local-chromium/mac-588429 under version 71.0.3542.0

What steps will reproduce the problem?

const puppeteer = require("puppeteer");

(async() => {   
	browser = await puppeteer.launch();
	page = await browser.newPage();	    
	await page.setRequestInterception(true);
	page.on("request", request => {
		console.log(request.url());
   		request.continue();	
	});

	await page.goto("https://example.url", { timeout: 0, waitUntil: "networkidle0" });
})();     

What is the expected result? Requests continues successfully.

What happens instead? https://fonts.gstatic.com/s/lato/v14/S6uyw4BMUTPHjxAwWyWtFCc.ttf https://fonts.gstatic.com/s/lato/v14/S6u9w4BMUTPHh50XSwaPHA3q5d0.ttf https://fonts.gstatic.com/s/lato/v14/S6u9w4BMUTPHh6UVSwaPHA3q5d0.ttf https://example.url/j_spring_security_check

(node:85615) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded

(node:85615) 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.

== I’ve re-installed puppeteer a few times yesterday so I supposed I got the rolled back version of Chromium. I’ve also tried --ignore-certificate-errors or --enable-features=NetworkService, but not much luck here. Rolling back to 1.6.2 w/ earlier verison of chromium works, but then the fix to set pdf window size in 1.8.0 will not be included.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
aslushnikovcommented, Jun 6, 2019

Please, try these URLs with the code above. http://m.todayhumor.co.kr/view.php?table=total&no=9408788 http://footsell.co.kr/product/detail.html?product_no=32952&cate_no=415&display_group=1 http://m.typemoon.net/plugin/mobile/board.php?bo_table=forum_neta&wr_id=3329

@batt842 all these URLs work with Puppeteer 1.17.0.

Everybody: request interception is getting better and better in recent Puppeteer versions. So please, give it chance!

If request interception still doesn’t work for you in the latest Puppeteer version, please file a new issue with a good repro we can play with!!

2reactions
Alex0007commented, Nov 18, 2018

I’m having same issue on 1.10.0

adding this snippet gives navigationTimeout error on some pages, for example on this page:

https://www.freepeople.com/shop/vintage-1960s-handmade-sweater/ Resource that blocks page from loading: https://www.freepeople.com/orchestration/js/navigation/

page.setRequestInterception(true)
page.on("request", r => r.continue())

Downgrading to 1.6.2 helped.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer - set navigation timeout for intercepted request
The following is the script snippet ... await page.setRequestInterception(true); let firstDocument = true; page.on( ...
Read more >
Page.setRequestInterception() method - Puppeteer
This provides the capability to modify network requests that are made by a page. Once request interception is enabled, every request will stall...
Read more >
How to use the pyppeteer.errors.TimeoutError function ... - Snyk
assertRaises(TimeoutError): await self.page.goto(self.url + 'long'). Was this helpful? ... setRequestInterception(True) wait_time = time.time() + self.
Read more >
API Reference — Pyppeteer 0.0.25 documentation
Make new page on this browser and return its object. ... timeout (int): Maximum navigation time in milliseconds, defaults to 30 seconds, pass...
Read more >
puppeteer-expected.json - mozsearch - Searchfox
"EventEmitter emit returns true if the event has listeners ... "navigation Page.goto should fail when exceeding default maximum timeout ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found