question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] browserType.launch: Protocol error (Browser.enable): Browser closed

See original GitHub issue

Context:

  • Playwright Version: 1.17.1
  • Operating System: Mac
  • Node.js version: 14.x
  • Browser: All
  • Extra: Azure pipelines CI run

Code Snippet

playwright.chromium.launch();

Describe the bug

We had a failing Azure pipelines CI run in https://dev.azure.com/monacotools/Monaco/_build/results?buildId=148061&view=logs&j=3792f238-f35e-5f82-0dbc-272432d9a0fb&t=0d7e5bc9-922f-51dd-b06a-a90d0b9feeeb&l=13 with the following output printed:

Starting: Run unit tests (Browser, Chromium & Firefox & Webkit)
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.182.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /Users/runner/work/_temp/0b41947a-56e7-4f3d-ba2f-309cb70379dc.sh
yarn run v1.22.17
$ node test/unit/browser/index.js --build --browser chromium --browser webkit --browser firefox --tfs 'Browser Unit Tests'
browserType.launch: Protocol error (Browser.enable): Browser closed.
==================== Browser output: ====================
<launching> /Users/runner/Library/Caches/ms-playwright/firefox-1304/firefox/Nightly.app/Contents/MacOS/firefox -no-remote -headless -profile /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/playwright_firefoxdev_profile-8oqYFV -juggler-pipe -silent
<launched> pid=11682
[pid=11682][err] *** You are running in headless mode.
=========================== logs ===========================
<launching> /Users/runner/Library/Caches/ms-playwright/firefox-1304/firefox/Nightly.app/Contents/MacOS/firefox -no-remote -headless -profile /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/playwright_firefoxdev_profile-8oqYFV -juggler-pipe -silent
<launched> pid=11682
[pid=11682][err] *** You are running in headless mode.
============================================================
    at runTestsInBrowser (/Users/runner/work/1/s/test/unit/browser/index.js:127:48)
    at /Users/runner/work/1/s/test/unit/browser/index.js:239:17
    at /Users/runner/work/1/s/test/unit/browser/index.js:237:32 {
  name: 'Error'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]Bash exited with code '1'.
Finishing: Run unit tests (Browser, Chromium & Firefox & Webkit)

Asking here for advice if there is something we can do about it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:37 (31 by maintainers)

github_iconTop GitHub Comments

1reaction
bpaserocommented, Jan 15, 2022

Pushed to main, will report back how it goes next week.

1reaction
bpaserocommented, Jan 11, 2022

After discussion with team we have decided to stop running builds in parallel in our CI machines. Will report back how that goes over coming days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BrowserType.launch: Protocol error (Browser.getVersion ...
Error: BrowserType.launch: Protocol error (Browser.getVersion): Browser closed when running codeceptjs docker image thru Dockerfile.
Read more >
Error - Target closed - Checkly
Obvious possible cause: the browser, context or tab is being closed at the wrong time in the script. Not-so-obvious possible cause: promises are...
Read more >
playwright._impl._api_types.error: browser closed. - You.com
Describe the bug I used this code a few days ago and it worked fine, ... Error: Protocol error (Playwright.enable): Browser closed. on...
Read more >
Browser launch error on Raspberry Pi 3 - Robot Framework
browserType.launch: Protocol error (Browser.getVersion): Browser closed. ==================== Browser output: ==================== /home/pi/.
Read more >
(Puppeteer) Protocol error (Target.setDiscoverTargets)
Open Bug 1734896 Opened 1 year ago Updated 7 months ago. (Puppeteer) Protocol error (Target. ... The opening tab is going to be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found