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

[Bug]: Exception raised when trying to use puppeteer to close a tab which is opened manually. #7896

Closed
findwater opened this issue Jan 13, 2022 · 2 comments
Labels

Comments

@findwater
Copy link

Bug description

Steps to reproduce the problem:

  1. Use puppeteer to launch chrome(97.0.4692.71)
  2. Add a new tab MANUALLY
  3. Use puppeteer to close the tab which is added manually
  4. Exception raised complaining a frame object is undefined.

The code to reproduce the issue is attached. It will

  1. Launch chrome
  2. Wait for 10 seconds
  3. Add a new tab manually
  4. After 10 seconds, close the newly added tab and you will see some errors in console.
    TestPuppeteerCore.zip

A video is attached to showcase the issue.
https://user-images.githubusercontent.com/8121062/149273899-6fd1f271-2a0f-44f7-8730-ef5e71c33754.mp4

PS: This issue is NOT reproduced with puppeteer 10.2.0. It can be reproduce with 11.0.0, 12.0.0, 13.0.1

Puppeteer version

12.0.0

Node.js version

16.13.0

npm version

8.1.0

What operating system are you seeing the problem on?

Windows

Relevant log output

TypeError: Cannot read properties of undefined (reading '_updateClient')
    at FrameManager._onAttachedToTarget (D:\MyProjects\NodeJs\TestPuppeteerCore\node_modules\puppeteer-core\lib\cjs\puppeteer\common\FrameManager.js:183:15)
    at D:\MyProjects\NodeJs\TestPuppeteerCore\node_modules\puppeteer-core\lib\cjs\puppeteer\common\FrameManager.js:88:18
    at D:\MyProjects\NodeJs\TestPuppeteerCore\node_modules\puppeteer-core\lib\cjs\vendor\mitt\src\index.js:51:62
    at Array.map (<anonymous>)
    at Object.emit (D:\MyProjects\NodeJs\TestPuppeteerCore\node_modules\puppeteer-core\lib\cjs\vendor\mitt\src\index.js:51:43)
    at CDPSession.emit (D:\MyProjects\NodeJs\TestPuppeteerCore\node_modules\puppeteer-core\lib\cjs\puppeteer\common\EventEmitter.js:72:22)
    at CDPSession._onMessage (D:\MyProjects\NodeJs\TestPuppeteerCore\node_modules\puppeteer-core\lib\cjs\puppeteer\common\Connection.js:245:18)
    at Connection._onMessage (D:\MyProjects\NodeJs\TestPuppeteerCore\node_modules\puppeteer-core\lib\cjs\puppeteer\common\Connection.js:117:25)
    at WebSocket.<anonymous> (D:\MyProjects\NodeJs\TestPuppeteerCore\node_modules\puppeteer-core\lib\cjs\puppeteer\node\NodeWebSocketTransport.js:13:32)
    at WebSocket.onMessage (D:\MyProjects\NodeJs\TestPuppeteerCore\node_modules\ws\lib\event-target.js:199:18)

Process finished with exit code 1
@findwater findwater added the bug label Jan 13, 2022
@findwater findwater changed the title [Bug]: [Bug]: Exception raised when trying to use puppeteer to close a tab which is opened manually. Jan 13, 2022
@OrKoN
Copy link
Collaborator

OrKoN commented Jan 14, 2022

Looks like the same issue as #7844

@findwater
Copy link
Author

Thank you for solving the problem in such a short time.

OrKoN added a commit that referenced this issue Jan 17, 2022
OrKoN added a commit that referenced this issue Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants