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]: Issue with BiDi-powered logging #10032

Closed
2 tasks
mathiasbynens opened this issue Apr 17, 2023 · 4 comments
Closed
2 tasks

[Bug]: Issue with BiDi-powered logging #10032

mathiasbynens opened this issue Apr 17, 2023 · 4 comments
Assignees

Comments

@mathiasbynens
Copy link
Member

mathiasbynens commented Apr 17, 2023

Bug expectation

I expected to get a message logged to my terminal, but I didn’t get any.

Bug behavior

  • Flaky
  • PDF

Minimal, reproducible example

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
  protocol: 'webDriverBiDi',
});

const context = await browser.createIncognitoBrowserContext();
const page = await context.newPage();

page.on('console', (message) => {
  console.log(`Unexpected console message received: [${
    message.type()
  }] ${message.text()}`);
});


await page.goto(`data:text/html,<script>console.log('1');</script>`);

Error string

No error

Puppeteer configuration

No response

Puppeteer version

19.9.0

Node version

16.14.0

Package manager

npm

Package manager version

8.14.0

Operating system

macOS

@sadym-chromium
Copy link
Collaborator

sadym-chromium commented Apr 20, 2023

I added the following script to the file example/qwe.js of Puppeteer and run it via NODE_PATH=../ node examples/qwe.js. I get the Unexpected console message received: [log] 1 message in console. What did I do wrong?

const puppeteer = require('puppeteer');

(async () => {

  const browser = await puppeteer.launch({
    protocol: 'webDriverBiDi',
  });

  const context = await browser.createIncognitoBrowserContext();
  const page = await context.newPage();

  page.on('console', (message) => {
    console.log(`Unexpected console message received: [${
      message.type()
    }] ${message.text()}`);
  });

  await page.goto(`data:text/html,<script>console.log('1');</script>`);
})();

@sadym-chromium
Copy link
Collaborator

First suspect is not waiting for the subscribe command to finish:

@sadym-chromium
Copy link
Collaborator

The root cause is fixed in Mapper in GoogleChromeLabs/chromium-bidi@55680d5. Puppeteer needs to be updated.

@Lightning00Blade
Copy link
Collaborator

Closed by #10060

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants