Ryan Cocuzzo
Ryan Cocuzzo

Reputation: 3219

Puppeteer undefined symbol

I am using Puppeteer in a function that will send results back via WebSockets. Whenever I perform browser.close() in this function, I am getting this error:

_http_agent.js:444
      options = req[kRequestOptions];
                   ^

TypeError: Cannot read property 'Symbol(requestOptions)' of undefined
    at Agent.removeSocket (_http_agent.js:444:20)
    at TLSSocket.onClose (_http_agent.js:371:11)
    at TLSSocket.emit (events.js:326:22)
    at net.js:672:12
    at TCP.done (_tls_wrap.js:563:7)

I have had no problems with this code before now, so I'm not sure if one of the two underwent an update that caused incompatibility with each other or web sockets.

Upvotes: 1

Views: 610

Answers (1)

user1492302
user1492302

Reputation: 21

I had a similar issue in one of the projects where I was modifying the Object prototype itself. Once I removed that offending code, it started working fine. This issue happened only after upgrading from Node v13 to v14 or above. So try removing any Object prototype modifications you might have in your code.

Upvotes: 1

Related Questions