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.

TypeError: Cannot read property 'call' of null

See original GitHub issue

This gets tricky since I can’t really provide you the best steps to reproduce. We have a flow that opens in a popup. Once you click the final “Done” button, it dismisses the popup. In the latest versions of Puppeteer (1.12.0+) this seems to also close the page that opened the popup (This should not be happening. This page should redirect.)

This issue does NOT occur on Puppeteer 1.10.0. (I suspect the issue may actually lie in Chromium, but figured I’d start here.)

Tell us about your environment:

  • Puppeteer version: 1.13.0
  • Platform / OS version: macOS 10.14.2
  • Node.js version: 10.15.0

What steps will reproduce the problem?

I can’t really provide a code snippet, but essentially we perform a page.click(doneButton);, the click is successful, then after a second or two both the popup, and the original page are torn down (the entire browser, actually) and this error is thrown:

TypeError: Cannot read property 'call' of null

      at DOMWorld._setContext (../../node_modules/puppeteer/lib/DOMWorld.js:61:36)
      at FrameManager._onExecutionContextCreated (../../node_modules/puppeteer/lib/FrameManager.js:303:13)
      at CDPSession.FrameManager._client.on.event (../../node_modules/puppeteer/lib/FrameManager.js:52:70)
      at CDPSession._onMessage (../../node_modules/puppeteer/lib/Connection.js:200:12)
      at Connection._onMessage (../../node_modules/puppeteer/lib/Connection.js:112:17)
      at WebSocketTransport._ws.addEventListener.event (../../node_modules/puppeteer/lib/WebSocketTransport.js:41:24)
      at WebSocket.onMessage (../../node_modules/ws/lib/event-target.js:120:16)
      at Receiver.receiverOnMessage (../../node_modules/ws/lib/websocket.js:741:20)

I’m aware this is probably not enough to go on, so if there are additional logs that I can grab (and you can provide me with instructions on how to grab them) I’d be happy to provide some more logging.

What is the expected result? Original page should remain and redirect.

What happens instead? Original page is destroyed and the entire browser instance is closed.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
jeremymarccommented, Apr 3, 2019

My tests start failing today with the exact same errors (early termination). I’m using puppeteer with browserless

(node:57) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'call' of null
    at DOMWorld._setContext (/opt/app/node_modules/puppeteer/lib/DOMWorld.js:61:36)
    at FrameManager._onExecutionContextCreated (/opt/app/node_modules/puppeteer/lib/FrameManager.js:303:13)
    at CDPSession.FrameManager._client.on.event (/opt/app/node_modules/puppeteer/lib/FrameManager.js:52:70)
    at CDPSession.emit (events.js:193:13)
    at CDPSession._onMessage (/opt/app/node_modules/puppeteer/lib/Connection.js:200:12)
    at Connection._onMessage (/opt/app/node_modules/puppeteer/lib/Connection.js:112:17)
    at WebSocketTransport._ws.addEventListener.event (/opt/app/node_modules/puppeteer/lib/WebSocketTransport.js:41:24)
    at WebSocket.onMessage (/opt/app/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:193:13)
    at Receiver.receiverOnMessage (/opt/app/node_modules/ws/lib/websocket.js:741:20)
3reactions
jeremymarccommented, Apr 3, 2019

it’s still happening for me and 1.14

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'call' of undefined ...
One of the solution was to use concatenateModules: false apparently, but to no avail, it didn't solve my issue. So I tried with...
Read more >
Uncaught TypeError: Cannot read property 'call' of undefined
I'm having an issue with webpack where if I stop watching and restart, it will build just fine, but if I edit a...
Read more >
Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError: Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an undefined...
Read more >
Resolving "Cannot call method * of null" or "Cannot read ...
Description : A common error thrown both in customerror logs and the error logs points to an issue with reading a property or...
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