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]: TypeError: Cannot read properties of undefined (reading '_updateClient') #7844

Closed
vmirage opened this issue Dec 14, 2021 · 2 comments
Closed
Labels

Comments

@vmirage
Copy link

vmirage commented Dec 14, 2021

Bug description

Steps to reproduce the problem for puppeteer-core:

  1. Make sure https://c2c.huobi.com/en-us/one-trade/buy tab is already open
  2. Use puppeteer-core to connect to existing chrome
  3. Get the page on targetcreated.
  4. Boom! error
      const browser = await puppeteer.connect({
        browserURL: 'http://127.0.0.1:9222',
        defaultViewport: null,
      });

      browser.on('targetcreated', async (e) => {
        try {
          let type = await e.type();
          if (type != 'page') {
            return;
          }
          let page = await e.page();
        } catch (e) {
          console.error(e);
        }
      });

No problem on version 10. Problem started since version 11 onwards

Puppeteer version

13.0.0

Node.js version

17.2.0

npm version

8.3.0

What operating system are you seeing the problem on?

macOS

Relevant log output

TypeError: Cannot read properties of undefined (reading '_updateClient')
    at FrameManager._onAttachedToTarget (/Volumes/data_ssd/test/node_modules/puppeteer-core/src/common/FrameManager.ts:260:11)
    at /Volumes/data_ssd/test/node_modules/puppeteer-core/src/common/FrameManager.ts:127:12
    at /Volumes/data_ssd/test/node_modules/puppeteer-core/vendor/mitt/src/index.ts:88:75
    at Array.map (<anonymous>)
    at Object.emit (/Volumes/data_ssd/test/node_modules/puppeteer-core/vendor/mitt/src/index.ts:88:56)
    at CDPSession.emit (/Volumes/data_ssd/test/node_modules/puppeteer-core/src/common/EventEmitter.ts:102:18)
    at CDPSession._onMessage (/Volumes/data_ssd/test/node_modules/puppeteer-core/src/common/Connection.ts:320:12)
    at Connection._onMessage (/Volumes/data_ssd/test/node_modules/puppeteer-core/src/common/Connection.ts:153:28)
    at WebSocket.<anonymous> (/Volumes/data_ssd/test/node_modules/puppeteer-core/src/node/NodeWebSocketTransport.ts:47:42)
    at WebSocket.onMessage (/Volumes/data_ssd/test/node_modules/ws/lib/event-target.js:199:18)
[ERROR] 06:01:32 TypeError: Cannot read properties of undefined (reading '_updateClient')
@vmirage vmirage added the bug label Dec 14, 2021
@OrKoN
Copy link
Collaborator

OrKoN commented Dec 22, 2021

So it does not happen if https://c2c.huobi.com/en-us/one-trade/buy is opened by Puppeteer?

@vmirage
Copy link
Author

vmirage commented Dec 23, 2021

No problem when opening by Puppeteer. Only when the page exist and Puppeteer starts.

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