It definitely is possible to use WebViewer in an Electron app. I would recommend checking out the Electron set up guide and verify that you are set up properly. You can find the details as well as a sample here: https://www.pdftron.com/documentation/web/get-started/electron/.
Areas to take note of is the WebViewer lib folder under the public folder and App.js where WebViewer is initialized.
Let me know if this helps!