Electron fails to start lib
Using Electron 4 I cant start the smartcard lib on Windows 10 It works well when using node in start script...
Part of error log:
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'electron .' ]
11 silly lifecycle [email protected]~start: Returned: code: 3228369023 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: electron .
13 verbose stack Exit status 3228369023
13 verbose stack at EventEmitter.electron .
22 error Exit status 3228369023
I had a similar problem and even though this issue is 3 years old I'm hoping this might help someone.
I created and packaged my Electron app using electron-forge, the build was made with the Squirrel maker.
Installing the app on my machine would, of course, yield no problems. On my client's machine though, it would install (failing to create a shortcut but that's irrelevant) but launching the app would result in no response (a process would start, but no window would show).
Turns out the problem was me calling "const devices = new Devices()" in the file I used to contain all smart card functions (let's say SmartCardReader.js), outside of any functions, so right after imports.
Moving the line to declare "devices" inside of each function solved the issue. This does mean that in each function I had to wait for onActivated() before doing anything with the reader, since "devices" does not get populated by the constructor.
I would venture to guess that one could set a "devices" variable to null right after imports and have a function initialize it before using the variable inside other functions.
I haven't tried this yet though, so take it at face value.
Hope this helps, have a nice day everyone!