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]: _electron.launch intermittently loses a packaged app's first window since 1.64.0 #43247
Package an Electron app (we're on Electron 44.5.1) whose ready handler creates a hidden BrowserWindow and only calls loadURL on it after an await:
app.on("ready",async()=>{constwin=newBrowserWindow({show: false,title: "My App"});awaitnewPromise((r)=>setTimeout(r,1000));awaitwin.loadURL(`file://${__dirname}/index.html`);win.once("ready-to-show",()=>win.show());});
Launch the packaged executable (packaged with @electron/packager) and wait for the window:
The window is reported in app.windows() / firstWindow(), as in 1.63.0.
Actual behavior
Intermittently, the window is never reported. app.windows() stays empty and firstWindow() times out, while the app itself is running normally. In our CI, the packaged app running is running in mcr.microsoft.com/playwright:v1.64.0.
For packaged apps, electron.ts does not inject loader.js, so the ready event is not deferred until __playwright_run(). The app creates its windows while CRBrowser.connect is still running with _isConnecting = true.
A hidden BrowserWindow that has not navigated yet has no renderer, so it is treated as crashed and dropped. Its target stays attached, so it is never reported again, even after it navigates.
#42936 explicitly noted that "a new page might not have a renderer yet, e.g. an Electron window before its first navigation, and must not be treated as crashed". Its CI caught the Electron firstWindow delayed-navigation test timing out, and the fix limited the check to pre-existing pages. #43075 widened the condition to _isConnecting. Playwright's Electron tests launch unpackaged apps, where the loader defers ready until after connecting, so they don't cover this path.
Environment
System: Ubuntu 24.04 (mcr.microsoft.com/playwright:v1.64.0), GitHub Actions ubuntu-latest
Node: 24.21.0
Electron: 44.5.1 (packaged app using @electron/packager, launched via executablePath)
@playwright/test: 1.64.0
Activity