panther icon indicating copy to clipboard operation
panther copied to clipboard

bug: `--auto-open-devtools-for-tabs` is broken on latest chromium version (137)

Open Crovitche-1623 opened this issue 5 months ago • 1 comments

Hi,

I just wanted to report an annoying problem I encountered with the latest version of chromium, and how I managed to solve it (so that other developers don’t waste time on it).

Bug

Using the version 137 of chromium, some requests will fail mysteriously with the following error code:

{"code":-32000,"message":"Browser window not found"}

see https://stackoverflow.com/questions/79641152/error-code-32000-messagebrowser-window-not-found-with-usage-auto-op

Solution

The devtools are enabled by defaults on symfony/panther. I solved the problem either by using the previous version of Chromium (136), which is not recommended for security reasons if you’re accessing public websites, or by disabling DevTools with the PANTHER_DEVTOOLS=0 environment variable.

Crovitche-1623 avatar Jun 03 '25 09:06 Crovitche-1623

Note: the problem occurred on both arm64 (e.g. Macbook with MX chips) and amd64 (ubuntu-22.04 on GitHub action) builds.

Crovitche-1623 avatar Jun 03 '25 09:06 Crovitche-1623

Thanks for opening this issue, our functional tests for Symfony UX Turbo were broken since few weeks now...

We had the following exception, and debugging it was quite a mess:

Facebook\WebDriver\Exception\NoSuchWindowException: no such window: target window already closed from unknown error: web view not found

Setting <server name="PANTHER_DEVTOOLS" value="0"/> in our phpunit.xml.dist worked like a charm.

Kocal avatar Jun 28 '25 07:06 Kocal

Glad that it helped @Kocal 👍🏻

Crovitche-1623 avatar Jun 30 '25 14:06 Crovitche-1623

Thanks, had the same issue on https://github.com/php-debugbar/php-debugbar Not sure why it broke suddenly, but the solution in https://github.com/symfony/panther/issues/675#issuecomment-3015040659 worked for me

barryvdh avatar Jul 16 '25 07:07 barryvdh

Opened https://github.com/symfony/recipes/pull/1437, not ideal but better than nothing

Kocal avatar Jul 16 '25 07:07 Kocal

Maybe could we detect the chrome version and disable this if this is a broken one?

dunglas avatar Jul 16 '25 14:07 dunglas

Do you mean always forcing PANTHER_DEVTOOLS=0 when Chrome 137 (if we could detect the version), or still respect user's PANTHER_DEVTOOLS definition?

Also, I feel like enabling devtools by default feels wrong to me, in should be an opt-in (i.e.: when you use your browser or use Panther to crawl websites, dev-tools are useless but only useful when debugging)

Kocal avatar Jul 21 '25 19:07 Kocal

I agree with @Kocal that devtools should not be enabled by default. I don't think most devs use the possibilities offered by the devtools (perfomance analysis etc.).

Crovitche-1623 avatar Aug 04 '25 12:08 Crovitche-1623

https://github.com/symfony/panther/pull/679

dmitryuk avatar Aug 25 '25 14:08 dmitryuk