Error: Protocol error (Runtime.callFunctionOn): Object reference chain is too long undefined
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.5.0
- Platform / OS version: macOS 10.13.4
- Node.js version: v9.3.0
What steps will reproduce the problem?
(async ()=> {
const cssSelector = '.sidebar-group-items > li > a';
// const url = 'demo'; // the url is an Intranet
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url, { waitUntil: 'load' });
try {
let links = await page.$$eval(cssSelector, links => {
return links.map( a => {
return {
href: a.href.trim(),
title: a.innerText
}
});
});
await browser.close();
return links;
} catch (error) {
throw new Error(error);
}
})()
What is the expected result?
I want to get the directory array of the page, it was working fine on Puppeteer 1.4 and when I upgraded to 1.5 it stopped working. But it seems to be working again in other web (cssSelector changed accordingly)
What happens instead?
UnhandledPromiseRejectionWarning: Error: Protocol error (Runtime.callFunctionOn): Object reference chain is too long undefined
at Promise (/Users/hedonghui/workspace/test/node_modules/_puppeteer@1.5.0@puppeteer/lib/Connection.js:202:56)
at new Promise (<anonymous>)
at CDPSession.send (/Users/hedonghui/workspace/test/node_modules/_puppeteer@1.5.0@puppeteer/lib/Connection.js:201:12)
at JSHandle.jsonValue (/Users/hedonghui/workspace/test/node_modules/_puppeteer@1.5.0@puppeteer/lib/ExecutionContext.js:193:43)
at ElementHandle.$$eval (/Users/hedonghui/workspace/test/node_modules/_puppeteer@1.5.0@puppeteer/lib/ElementHandle.js:309:29)
at process._tickCallback (internal/process/next_tick.js:68:7)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Protocol error (Runtime.callFunctionOn): Object reference ...
The tests eventually error with message: Fatal error: Protocol error (Runtime.callFunctionOn): Object reference chain is too long.
Read more >Fatal error: Protocol error (Runtime.callFunctionOn): Object ...
Fatal error: Protocol error (Runtime.callFunctionOn): Object reference chain is too long ... npm run grunt i get this error message.
Read more >Protocol error (Runtime.callFunctionOn): Object is not ...
This is from Puppeteer unit tests like 'window.open should use parent tab context' in browsercontext.spec.js. Overall I can see it 16 times in...
Read more >Error "Object reference chain is too long" on querySelectorAll ...
but this code gives me the error "Object reference chain is too long" on the first line. This code works though:
Read more >webdriverio/webdriverio - Gitter
and in the latest chromedriver I get unknown error: unknown error: unhandled inspector error: {"code":-32000,"message":"Object reference chain is too long"} ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So apparently this issue was caused by the following line:
https://github.com/GoogleChrome/puppeteer/blob/38f112f39546fc76a1ac3da7b42c02626fc581b1/lib/ElementHandle.js#L309
which was removed in a previous commit already.
In the meanwhile, you can use:
npm i --save puppeteer@next
@aslushnikov @joelEinbinder - fyi
had to revert to v
1.3.0