- 编剧版本:[v1.38.1]
- 操作系统:[macOS 13.5.2、macOS 14.0]
- 浏览器:[Chromium、Firefox]
- 其他信息:Chromium 117.0.5938.62(playwright build v1080)、Firefox 117.0(playwright build v1424)
- [ ] 我提供了准确的源代码,可以在本地重现该问题。
测试文件(独立)
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await browser.close();
})();
const { firefox } = require('playwright');
(async () => {
const browser = await firefox.launch();
await browser.close();
})();
脚步
- 运行测试。
预期的
测试结束,没有任何错误。
实际的
第一个测试导致此错误:
/Users/.../nodejs/playwright/node_modules/playwright-core/lib/server/chromium/crPage.js:377
this._firstNonInitialNavigationCommittedReject(new Error('Page closed'));
^
Error: Page closed
at CRSession.<anonymous> (/Users/.../nodejs/playwright/node_modules/playwright-core/lib/server/chromium/crPage.js:377:54)
at Object.onceWrapper (node:events:627:28)
at CRSession.emit (node:events:525:35)
at /Users/.../nodejs/playwright/node_modules/playwright-core/lib/server/chromium/crConnection.js:211:39
第二个测试导致此错误:
node:internal/process/promises:279
triggerUncaughtException(err, true /* fromPromise */);
^
browserType.launch: Browser.enable): Browser closed.
==================== Browser output: ====================
<launching> /Users/.../Library/Caches/ms-playwright/firefox-1424/firefox/Nightly.app/Contents/MacOS/firefox -no-remote -headless -profile /var/folders/dt/9bj0djrs22x5g66k9_nbz2zc0000gn/T/playwright_firefoxdev_profile-dxdJBm -juggler-pipe -silent
<launched> pid=18686
[pid=18686][err] *** You are running in headless mode.
[pid=18686] <process did exit: exitCode=null, signal=SIGSEGV>
[pid=18686] starting temporary directories cleanup
=========================== logs ===========================
<launching> /Users/.../Library/Caches/ms-playwright/firefox-1424/firefox/Nightly.app/Contents/MacOS/firefox -no-remote -headless -profile /var/folders/dt/9bj0djrs22x5g66k9_nbz2zc0000gn/T/playwright_firefoxdev_profile-dxdJBm -juggler-pipe -silent
<launched> pid=18686
[pid=18686][err] *** You are running in headless mode.
[pid=18686] <process did exit: exitCode=null, signal=SIGSEGV>
[pid=18686] starting temporary directories cleanup
============================================================
at /Users/.../nodejs/playwright/test/example.test2.js:4:33
at Object.<anonymous> (/Users/.../nodejs/playwright/test/example.test2.js:7:3) {
name: 'Error'
}
请注意,在第二个测试中,甚至没有调用创建新页面。
浏览器版本 Chromium 117.0.5938.62(playwright build v1080)和 Firefox 117.0(playwright build v1424)在 macOS 13.5.2 和 macOS 14.0 中启动时似乎会崩溃。
注意:我遇到了类似的问题,但使用的是 Playwright 1.36.2 以及 Firefox 和 Webkit。唯一运行良好的浏览器是 Chromium。