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.

Error: Protocol error (Runtime.callFunctionOn): Object reference chain is too long undefined

See original GitHub issue

Steps 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:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
yanivefraimcommented, Jun 18, 2018

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

3reactions
pariolacommented, Jun 17, 2018

had to revert to v1.3.0

Read more comments on GitHub >

github_iconTop 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 >

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