panther
panther copied to clipboard
bug: `--auto-open-devtools-for-tabs` is broken on latest chromium version (137)
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.
Note: the problem occurred on both arm64 (e.g. Macbook with MX chips) and amd64 (ubuntu-22.04 on GitHub action) builds.
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.
Glad that it helped @Kocal 👍🏻
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
Opened https://github.com/symfony/recipes/pull/1437, not ideal but better than nothing
Maybe could we detect the chrome version and disable this if this is a broken one?
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)
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.).
https://github.com/symfony/panther/pull/679