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
Electron 10.1.1 app crashes when saving a pdf from the print dialog #25397
Comments
Just tried electron 11.0.0-beta.6 and this issue is fixed in that version |
Seems to be a duplicate of #25327 At least I came to the same conclusion in my fiddle :) |
@hmt I'm having no problems actually printing from my app -- for me it's the PDF menu in the print dialog that crashes the app. Looking at it again, the gist I posted is a bit simpler than the actual setup in my app. In my app, on printing I create a new hidden browserWindow with the contents to print in it and then close the hidden browserWindow after printing. For me, printing works every time using this method. What doesn't work is the PDF menu. |
I mean, blaming the callback seems to fit both categories. Probably the underlying problem is the same in both instances. PDF printing and printing in general. |
Yep, this is known - it's not the callback per se as this is specific to the dialog presented by the pdf viewer. The wiring is not the same. |
@codebytere thanks for the explanation. |
I can repro this in 10.1.2 on Windows 10. not mac specific |
Is this the same as this issue? |
They look different - just tested the other one. I'll try to look today. The other one is reproable in master. Edit: PR for the other one is now up. |
Electron v10.1.2 From a Renderer Window, crash happens when the window itself is closed after this function as been called: window.print(); main.js that produce the crash all the time when invoked: //todo fix crashing of print
function printNormal() {
return new Promise((resolve) => {
const window = BrowserWindow.getFocusedWindow();
window.webContents.print({}, (success, errorType) => {
if (!success) return console.log(errorType);
resolve({success, errorType});
});
});
} |
@alex-drocks that is solved with #25622, which i will backport when i have a moment |
This issue is fixed by #25530, due out in next release |
Thank you that is awesome. |
Preflight Checklist
Issue Details
Expected Behavior
I should be able to save a pdf file from the pdf menu without the app crashing
Actual Behavior
the pdf saves, but the app crashes
To Reproduce
Electron fiddle:
https://gist.github.com/c5de74c2973633e178803eef65b827df
Screenshots
Additional Information
It seems to be any of the options in this menu that crashes the app.
Removing the callback and running it like this:
seems to resolve it -- but I need the callback
The text was updated successfully, but these errors were encountered: