New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BrowserView crashes the app after resizing the BrowserWindow #19921
Comments
Hello @sofianguy , I'm also seeing this issue, with the same error code. I'm trying to deploy an app that uses BrowserView. May I know approximately when this issue can be resolved? Also, just in general, would you recommend using webview-tag as an alternative? I hesitate to use webview-tag since its documentation warns us against using it and instead recommends using BrowserView. Please let me know if you have any questions. Thank you for your time! :) Update: Since this may be a different issue than the OP's issue, I'll start open a new issue. Thanks! |
The solution I found requires calling // To init the BrowserView
var win = new BrowserWindow();
var view = new BrowserView();
win.addBrowserView(view); // Can also use win.removeBrowserView
// To destroy the BrowserView with no crash
win.removeBrowserView(view); // We remove the BrowserView from the BrowserWindow first so that the bug does not trigger when we resize the window
view.destroy();
I hope this works for you! It has seemed to fix the problem for me. It works on Linux for me at least, but it should also work on other platforms too. |
I experienced the same issue in both Electron 8.2.0 and Electron 9.0.0. removeBrowserView before calling destroy fixes the problem for me. However this should at least be mentioned in the documentation. In Electron 9 the Stacktrace looks like this:
|
Closed in #25411 |
Preflight Checklist
Issue Details
Expected Behavior
I can resize the window
Actual Behavior
The application freezes for a few seconds and crashes
To Reproduce
Screenshots
Additional Information
There are no such error with webview-tag
Log: 2019-08-24T11_30_07_911Z-debug.log
The text was updated successfully, but these errors were encountered: