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

page.evaluate() throws and hangs if returned value is an array with Symbol #2295

Closed
vsemozhetbyt opened this issue Mar 31, 2018 · 0 comments
Closed

Comments

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Mar 31, 2018

  • Puppeteer version: v1.2.0-post
  • Platform / OS version: Windows 7 x64
  • URLs (if applicable): any
  • Node.js version: 8-10
'use strict';

const puppeteer = require('puppeteer');

(async function main() {
  try {
    const browser = await puppeteer.launch();
    const [page] = await browser.pages();

    await page.evaluate(() => Symbol('foo1')); // OK
    await page.evaluate(() => ({ [Symbol('foo2')]: Symbol('foo3') })); // OK
    await page.evaluate(() => [Symbol('foo4')]); // throws and hangs

    await browser.close();
  } catch (err) {
    console.error(err);
  }
})();
{ Error: Protocol error (Runtime.callFunctionOn): Object couldn't be returned by value undefined
    at Promise (puppeteer/lib/Connection.js:198:56)
    at new Promise (<anonymous>)
    at CDPSession.send (puppeteer/lib/Connection.js:197:12)
    at JSHandle.jsonValue (puppeteer/lib/ExecutionContext.js:184:43)
    at ExecutionContext.evaluate (puppeteer/lib/ExecutionContext.js:47:33)
    at process._tickCallback (internal/process/next_tick.js:178:7)
  message: 'Protocol error (Runtime.callFunctionOn): Object couldn\'t be returned by value undefined' }
@vsemozhetbyt vsemozhetbyt changed the title page.evaluate() throws if returned value is an array with Symbol page.evaluate() throws and hangs if returned value is an array with Symbol Mar 31, 2018
aslushnikov added a commit to aslushnikov/puppeteer that referenced this issue Apr 10, 2018
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