You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Issue with Playwright 1.50.1 on macOS 15.3 (Sequoia) - Page closes unexpectedly in non-headless mode #34693
After upgrading to macOS 15.3 (Sequoia), I began encountering an issue where Playwright fails when launching Chromium in non-headless mode. Specifically, I am seeing the following error:
swift
Copy
Edit
Failed to create browser context or page: Error {
message='Page closed
name='Error
stack='Error: Page closed
at FrameSession.dispose (/private/var/folders/sw/mh9s52b17qz49p3629grjqnm0000gp/T/playwright-java-10961038274755770653/package/lib/server/chromium/crPage.js:492:52)
at CRPage.didClose (/private/var/folders/sw/mh9s52b17qz49p3629grjqnm0000gp/T/playwright-java-10961038274755770653/package/lib/server/chromium/crPage.js:152:60)
at CRBrowser._didDisconnect (/private/var/folders/sw/mh9s52b17qz49p3629grjqnm0000gp/T/playwright-java-10961038274755770653/package/lib/server/chromium/crBrowser.js:216:57)
at CRConnection. (/private/var/folders/sw/mh9s52b17qz49p3629grjqnm0000gp/T/playwright-java-10961038274755770653/package/lib/server/chromium/crConnection.js:84:39)
}
Steps to Reproduce:
Upgrade to macOS 15.3 (Sequoia).
Launch Playwright in non-headless mode using Chromium.
Encounter the "Page closed" error as soon as the browser context is created.
Expected Behavior: Playwright should launch Chromium in non-headless mode without issues.
Additional Information:
I'm using Playwright 1.50.1 (latest stable version).
The issue only started occurring after the macOS upgrade to 15.3 (Sequoia).
Running in headless mode works fine, and Chromium opens without any problems.
Permissions (Accessibility, Screen Recording, etc.) have been granted as required.
Environment:
macOS Version: 15.3 (Sequoia)
Playwright Version: 1.50.1
Browser: Chromium (non-headless mode)
Steps Taken to Resolve:
Tried reinstalling Playwright and Chromium (npx playwright install --force).
Tried running in headless mode (works fine).
Checked system permissions (Accessibility, Screen Recording, Full Disk Access).
Logs:
Error logs are included above.
Debugging logs from Playwright are available if needed.
Expected behavior
Playwright should launch Chromium in non-headless mode without issues, allowing interactions with the browser as expected.
Actual behavior
Playwright fails to launch Chromium in non-headless mode, with the error Page closed appearing immediately after the browser context is created.
Could you try running it with DEBUG=pw:browser env var set, this should give us more debug logs. Could you please provide a minimal reproducible, does it happen with e.g. this?
I have this issue as well. Here is a cleaned-up example of the debug logs:
DEBUG=pw:browser npx playwright test --headed tests/multiple-avatar-feature/avatar-label.spec.ts
> npx
> playwright test --headed tests/multiple-avatar-feature/avatar-label.spec.ts
Running 12 tests using 6 workers
[setup] › auth.setup.ts:72:6 › Authenticate as avatar admin user
pw:browser <launching> /Users/mishkinberteig/Library/Caches/ms-playwright/chromium-1148/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-field-trial-config --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding,ThirdPartyStoragePartitioning,LensOverlay,PlzDedicatedWorker --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --disable-search-engine-choice-screen --unsafely-disable-devtools-self-xss-warnings --enable-use-zoom-for-dsf=false --no-sandbox --user-data-dir=/var/folders/2y/zfl7htwn6_3_phj4kzl372_h0000gn/T/playwright_chromiumdev_profile-amK6mG --remote-debugging-pipe --no-startup-window +0ms
[setup] › auth.setup.ts:72:6 › Authenticate as avatar admin user
pw:browser <launched> pid=4834 +1ms
[setup] › auth.setup.ts:72:6 › Authenticate as avatar admin user
pw:browser [pid=4834][err] 2025-02-12 13:08:19.711 Chromium[4834:2509326] +[IMKClient subclass]: chose IMKClient_Modern +1s
[setup] › auth.setup.ts:72:6 › Authenticate as avatar admin user
pw:browser [pid=4834] <gracefully close start> +412ms
[setup] › auth.setup.ts:72:6 › Authenticate as avatar admin user
pw:browser [pid=4834] <process did exit: exitCode=0, signal=null> +577ms
pw:browser [pid=4834] starting temporary directories cleanup +0ms
[setup] › auth.setup.ts:72:6 › Authenticate as avatar admin user
pw:browser [pid=4834] finished temporary directories cleanup +36ms
pw:browser [pid=4834] <gracefully close end> +0ms
I have tried giving the playwright Chromium.app permission to run in System Settings > Privacy & Security > Developer Tools but that did not make any difference.
This is fairly urgent for me since I do the final check on our automated tests before approving the push to production.
rammesika That's a good workaround, but I don't want to use it if I can avoid it since my developers are (mostly) on windows. I could always set up an environment variable for this, but it's frustrating to do stuff like that :-) As you say: "...its really bad"
i run my Java test and saw.. without a reason, that the playwright is downloading ver 119... which is old ver. although there is a valid one 131...
seems like the root cause
Logger initialized: 1082811210 | Test: bestPractices | HTMLAccordion Initialized: true
Downloading Chromium 119.0.6045.9 (playwright build v1084) from https://playwright.azureedge.net/builds/chromium/1084/chromium-mac-arm64.zip
| | 0% of 131.1 Mb
|■■■■■■■■ | 10% of 131.1 Mb
|■■■■■■■■■■■■■■■■ | 20% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■ | 30% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 40% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 50% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 60% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 70% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 80% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 90% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 131.1 Mb
Chromium 119.0.6045.9 (playwright build v1084) downloaded to /Users/ram/Library/Caches/ms-playwright/chromium-1084
Downloading FFMPEG playwright build v1009 from https://playwright.azureedge.net/builds/ffmpeg/1009/ffmpeg-mac-arm64.zip
| | 1% of 1 Mb
|■■■■■■■■ | 11% of 1 Mb
...
rammesika re #34693 (comment) Looks like you are using an old Playwright version in your Java project. Check your pom.xml and look for v1.39 which is the same Chromium version (outdated) like which you are using. Upgrading Playwright should help you and then you don't need to use the new Chromium version from #34693 (comment) aka. your hack.
Mishkin Berteig (@MaxGood-AI)#34693 (comment) looks like a different issue. I recommend filing a new issue and following the issue template since mixing these two issues makes it confusing for the future.
Calculating task graph as configuration cache cannot be reused because file 'build.gradle' has changed.
FAILURE: Build failed with an exception.
What went wrong:
Configuration cache state could not be cached: field classpath of task :compileJava of type org.gradle.api.tasks.compile.JavaCompile: error writing value of type 'org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration'
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.
BUILD FAILED in 716ms
Playwright 1.50.1 is not available on Maven Central. Playwright for Java is currently only published up to version 1.39.0.?
Activity
mxschmitt commentedon Feb 10, 2025
Could you try running it with
DEBUG=pw:browserenv var set, this should give us more debug logs. Could you please provide a minimal reproducible, does it happen with e.g. this?MaxGood-AI commentedon Feb 12, 2025
I have this issue as well. Here is a cleaned-up example of the debug logs:
I have tried giving the playwright Chromium.app permission to run in System Settings > Privacy & Security > Developer Tools but that did not make any difference.
This is fairly urgent for me since I do the final check on our automated tests before approving the push to production.
Thanks!
mxschmitt commentedon Feb 12, 2025
Mishkin Berteig (@MaxGood-AI) are you on v1.50 as well? Could you try our Canary version?
rammesika commentedon Feb 12, 2025
this is what i get
~ ❯❯❯ npx playwright --version
Version 1.49.0
~ ❯❯❯ /Users/ram.mesika/Library/Caches/ms-playwright/chromium-1148/chrome-mac/Chromium.app/Contents/MacOS/Chromium --version
Chromium 131.0.6778.33
~ ❯❯❯ npx playwright open chromium
Error: net::ERR_CONNECTION_REFUSED at http://chromium/
Call log:
rammesika commentedon Feb 12, 2025
i will try chromium 131 and i will update
MaxGood-AI commentedon Feb 12, 2025
Max Schmitt (@mxschmitt) Got around to installing the Canary version:
Still getting the same error:
Thanks!
rammesika commentedon Feb 12, 2025
instead of this
/*
Browser browserOld = browserType.launch(new BrowserType.LaunchOptions()
.setHeadless(false)
.setArgs(Arrays.asList("--start-maximized")));
*/
i needed to use:
Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions()
.setHeadless(false)
.setExecutablePath(Paths.get("/Users/{my user}/Library/Caches/ms-playwright/chromium-1148/chrome-mac/Chromium.app/Contents/MacOS/Chromium"))
.setArgs(Arrays.asList("--start-maximized"))
);
MaxGood-AI commentedon Feb 12, 2025
rammesika That's a good workaround, but I don't want to use it if I can avoid it since my developers are (mostly) on windows. I could always set up an environment variable for this, but it's frustrating to do stuff like that :-) As you say: "...its really bad"
rammesika commentedon Feb 12, 2025
yes
i installed ver 131 of Chromiun manually.
i run my Java test and saw.. without a reason, that the playwright is downloading ver 119... which is old ver. although there is a valid one 131...
seems like the root cause
Logger initialized: 1082811210 | Test: bestPractices | HTMLAccordion Initialized: true
Downloading Chromium 119.0.6045.9 (playwright build v1084) from https://playwright.azureedge.net/builds/chromium/1084/chromium-mac-arm64.zip
| | 0% of 131.1 Mb
|■■■■■■■■ | 10% of 131.1 Mb
|■■■■■■■■■■■■■■■■ | 20% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■ | 30% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 40% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 50% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 60% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 70% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 80% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 90% of 131.1 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 131.1 Mb
Chromium 119.0.6045.9 (playwright build v1084) downloaded to /Users/ram/Library/Caches/ms-playwright/chromium-1084
Downloading FFMPEG playwright build v1009 from https://playwright.azureedge.net/builds/ffmpeg/1009/ffmpeg-mac-arm64.zip
| | 1% of 1 Mb
|■■■■■■■■ | 11% of 1 Mb
...
rammesika commentedon Feb 12, 2025
this line
Playwright playwright = Playwright.create();
is triggering the download of ver 119..
i added before
System.setProperty("PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD", "1");
doesnt help
rammesika commentedon Feb 13, 2025
i used this hack (but will appreciate if you can have a look at why its (119) installed)
mxschmitt commentedon Feb 13, 2025
rammesika re #34693 (comment) Looks like you are using an old Playwright version in your Java project. Check your pom.xml and look for v1.39 which is the same Chromium version (outdated) like which you are using. Upgrading Playwright should help you and then you don't need to use the new Chromium version from #34693 (comment) aka. your hack.
Mishkin Berteig (@MaxGood-AI) #34693 (comment) looks like a different issue. I recommend filing a new issue and following the issue template since mixing these two issues makes it confusing for the future.
rammesika commentedon Feb 13, 2025
i see why i used 1.39 and not 1.50.1
since i got
./gradlew clean build
Calculating task graph as configuration cache cannot be reused because file 'build.gradle' has changed.
FAILURE: Build failed with an exception.
Configuration cache state could not be cached: field
classpathof task:compileJavaof typeorg.gradle.api.tasks.compile.JavaCompile: error writing value of type 'org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration'BUILD FAILED in 716ms
Playwright 1.50.1 is not available on Maven Central. Playwright for Java is currently only published up to version 1.39.0.?
mxschmitt commentedon Feb 13, 2025
Yes, only 1.50.0 is available there, have you tried [v1.50.0](https://central.sonatype.com/artifact/com.microsoft.playwright/playwright?
rammesika commentedon Feb 13, 2025
tnx
1.50.0 is ok. needed to clean the cache and hope now 1.50.0 + Chromium Version: 133.0.6943.16
will do the job
mxschmitt commentedon Feb 14, 2025
Closing as per above since it seems to be solved.