Skip to content
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 crashes after canceling print #20426

Closed
3 tasks done
schnetzi opened this issue Oct 4, 2019 · 12 comments
Closed
3 tasks done

Electron crashes after canceling print #20426

schnetzi opened this issue Oct 4, 2019 · 12 comments

Comments

@schnetzi
Copy link

schnetzi commented Oct 4, 2019

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 5.0.11
  • Operating System:
    • macOS 10.14.6
  • Last Known Working Electron version:
    • 5.0.4

Expected Behavior

When I print using window.print(); the print dialog opens. But after clicking on cancel I want to be able to continue using the app.

Actual Behavior

After cancelling the print modal nothing is clickable anymore.

To Reproduce

I created a github repo with a "Print" button on the Home-page. It's the skeleton project.
https://github.com/schnetzi/electron-problem

$ git clone git@github.com:schnetzi/electron-problem.git
$ npm ci
$ npm start

If you install electron in version 5.0.4 it works again.

@vbennich
Copy link
Contributor

vbennich commented Oct 6, 2019

Hi @schnetzi This issue seems similar to #14705. I will try try to look further into this!

@bornova
Copy link

bornova commented Oct 8, 2019

I have the exact same problem. I call window.print() from a button click. If I go ahead and print, then all is good. However, if I cancel the print job, then my app freezes. All javascript functions stop working except I can still right click and enter text into input elements. I am using Electron version 6.0.11 and problem occurs on both MacOS and Windows 10.

@TerrapinSoftware
Copy link

TerrapinSoftware commented Oct 11, 2019

Easy to reproduce with the electron-quick-start repo. Just add this line to index.html:

<button onclick="window.print()">Click me</button>

Then click the button and choose Cancel. Try to click that button again. No reaction. Also, the devtools breakpoints do not work anymore. Try to set an event listener breakpoint on the click event...

Please increase the priority of this bug. Every electron app that supports printing cal fall victim to complete data loss!

@martinvergara26
Copy link

martinvergara26 commented Jan 17, 2020

I updated to electron 7.1.9 and it solved the issue (tested on Windows 7 and Windows 10)

@Celtak
Copy link

Celtak commented Jan 17, 2020

I try with electron 7.1.9 but my app still crashes. With 5.0.4 version no problem. I tested on a macOs 10.15.2.

@codebytere
Copy link
Member

This has been fixed in latest versions of Electron. @Celtak i could not reproduce this issue on the same setup - this may be an issue with your machine.

@schnetzi
Copy link
Author

schnetzi commented Jan 28, 2020

I created different branches in the given repository (https://github.com/schnetzi/electron-problem) to be able to check with the different electron versions:

  • master: electron version 5.0.11
  • version-5-latest: electron version 5.0.13
  • version-6-latest: electron version 6.1.7
  • version-7-latest: electron version 7.1.10
  • version-8-latest: electron version 8.0.0-beta.7

To Reproduce

I tried this now on windows. I will right away check on Mac as well.

In the versions 5.0.11, 5.0.13, 6.1.7

  1. Start the app
  2. Press print
  3. Press cancel
  4. Press print again
  5. Nothing happens

In the versions 7.1.10, 8.0.0-beta.7

  1. Start the app
  2. Press print
  3. Press cancel
  4. Press print
  5. Save the file as pdf
  6. (choose location on filesystem)
  7. Press print
  8. Save the file as pdf
  9. Nothing happens

Please let me know if you need any further information.

@schnetzi
Copy link
Author

On Mac I have a very similar behaviour.

Versions 5.0.11, 5.0.13, 6.1.7 behave the same as on windows.

In the versions 7.1.10, 8.0.0-beta.7 it appears that it saves the second pdf but when I take a look in the file-explorer it is not there. Only the first pdf got saved.

@schnetzi
Copy link
Author

schnetzi commented Feb 3, 2020

@codebytere can this be reopened or should I create another issue for that?

@schnetzi
Copy link
Author

schnetzi commented Feb 4, 2020

I just saw that you are talking in another issue about that and saying that it will be solved in the next versions: #21397

Thanks @codebytere

@celodauane
Copy link

Hi Guys. Is this issue fixed in the latest version of electron (9.1.0)?

@dipunj
Copy link

dipunj commented Sep 11, 2020

hi @dvuvne do you have any update on this? Been trying to print on macos (using electron v10.1.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
5.0.x
Unsorted Issues
Development

No branches or pull requests

10 participants