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] - Electron hangs closing the context

See original GitHub issue

Context:

  • Playwright Version: 1.20
  • Operating System: Windows 11
  • Node.js version: v16.13.0
  • Browser: ELECTRON

I use playwright to test both browser and electron. application is created with vue, vite and electron 18.2.0, and i cannot share sources in a repo for this issue. test is the same on browser and on electron, on browser, browser is opened with this


const browserContext = await webBrowser.newContext({
            locale: language,
            recordVideo: {
                dir: 'browser-videos/',
                size: { width: 640, height: 480 },
            },
            recordHar:{
                path:"browser-network.har"
            }
        })

application = await browserContext.newPage()      

on electron , electron is opened with this


const electronApp = await electron.launch({
recordVideo: {
        dir:"./electron-test-run-videos",
        size:{
            width:1280,
            height:720
        }
    },
    recordHar:{
        path:"electron-network.har"
    }
})
application = electronApp.firstWindow
 

due i want to store the har, has documented, i need to close the context. So at the end of the test, i do

await application.context().close
await application.close

Describe the bug

  • with browser, it works: i close the context and the har file is generated.
  • with electron, if i don’t close the contest, test pass but har file is not generated.

image

  • with electron, test hangs waiting until general timeout closing the context without trhow any exception, and at the end, the har file is generated.

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rwollcommented, May 21, 2022

Closing for now, but if you do happen to find a repro you can share, please file a new issue that references this one!

1reaction
andreabisellocommented, May 16, 2022

i’m so sorry, i cannot in this time 😦 i will try updating versions and when i could publish a demo version i’ll update this issue again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron.js app freezes after an hour unused [closed]
I wrote an app with electron.js and vuetify.js for Windows 64bit; ... hangs up and does not work, and the user is forced...
Read more >
Interop's Labyrinth: Sharing Code Between Web & Electron ...
The main process bootstraps the app and coordinates other processes in the background, while the renderer process is responsible for what the user...
Read more >
BrowserWindow | Electron
Calling event.preventDefault() will cancel the close. Usually you would want to use the beforeunload handler to decide whether the window should be closed, ......
Read more >
Electron Releases - GitHub Pages
The <webview> element now emits the context-menu event from the underlying webContents object. 1.4.14 January 10, 2017. Bug Fixes. Fixed a crash when...
Read more >
Demo app crashed on join meeting - Zoom Developer Forum
Additional context objc[6496]: Class NSTaskLauncher is implemented in both /Users/yongxingdeng/stenolabs/zoom-sdk-electron/demo/node_modules ...
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