Electron Crashes on Printing - Electron JS

Viewed 727

So I am using electron-pos-printer for sending the data to a thermal printer, but when I click on print, it prints it out but electron crashes, I can't really figure out why. I have also tried printing using the webContents.print() method but even that causes electron to crash.

Is there any previous version I can downgrade to that will fix it? Or is there any other solution?

2 Answers

Today 2020.9.29 Electron v10.1.3 has been released with fixing some issues.

Try to upgrade your electron version to the latest stable version.

Below are the release notes

v10.1.3 electron v10.1.3 Release Notes for v10.1.3

Fixes

Fixed CORS not being disabled by webSecurity: false. #25503 (Also in 9, 10, 11)

Fixed ready-to-show event not emitted on some machines. #25476 (Also in 9, 10, 11)

Fixed a crash in app.importCertificate() on Linux. #25536 (Also in 9, 10, 11)

Fixed a crash when closing window in an event listener after exiting fullscreen on macOS. #25604 (Also in 10, 11)

Fixed an issue that could cause a normally-exiting process to fail with an "illegal access" message and exit code 7. #25458 (Also in 8, 9, 10, 11)

Fixed an issue where an error would be displayed when using webContents.print() if no default was set and no device name provided. #25606 (Also in 9, 10, 11)

Fixed an issue where multiple calls to window.print() could cause a crash. #25530

Fixed an issue where pageRanges was not properly honored when printing. #25597 (Also in 10)

Fixed crashes caused by attempting to modify destroyed views. #25511 (Also in 9, 10, 11)

Fixed the remote-debugging-port discovery page showing garbled text. #25601 (Also in 10, 11)

Updated Node root certs to use NSS 3.56. #25361 (Also in 8, 9, 10, 11)

Other Changes

Added a small console hint to console to help debug renderer crashes. #25472 (Also in 9, 10, 11)

Fixed resource leak in worker threads. #25662 (Also in 9, 10, 11)

Updated Chromium to 85.0.4183.121. #25559

Unknown

Fixed extension background page devtools not being openable. #25566 (Also in 9, 10, 11)

I had the same issue. Turns out that installing the electron globally causes the crash. Try installing your electron in your local repository. This worked for me!!!

Related