asticode / astilectron

Electron app that provides an API over a TCP socket that allows executing Electron's method as well as capturing Electron's events
MIT License
285 stars 67 forks source link

BUGFIX: Invalid import in main.js #23

Closed yauheni-chaburanau closed 4 years ago

yauheni-chaburanau commented 4 years ago

So basically I faced this problem:

Uncaught Exception:
TypeError: app.requestSingleInstanceLock is not a function
    at Object.<anonymous> (/Users/user/.config/test/data/test/vendor/astilectron/main.js:9:35)
    at Module._compile (internal/modules/cjs/loader.js:880:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
    at Module.load (internal/modules/cjs/loader.js:735:32)
    at Module._load (internal/modules/cjs/loader.js:648:12)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
    at loadApplicationPackage (/Users/user/.config/test/data/test/vendor/electron-darwin-amd64/test.app/Contents/Resources/default_app.asar/main.js:109:16)
    at Object.<anonymous> (/Users/user/.config/test/data/test/vendor/electron-darwin-amd64/test.app/Contents/Resources/default_app.asar/main.js:155:9)
    at Module._compile (internal/modules/cjs/loader.js:880:30)

As I understand the problem is in import definition in main.js

I'm using this library together with go-astilectron library and this error happens only if

astilectron.Options{
    ...
    SingleInstance:     true,
    ...
}
asticode commented 4 years ago

LGTM

asticode commented 4 years ago

FYI I've tagged astilectron with v0.34.0 and bumped both go-astilectron and go-astilectron-demo

yauheni-chaburanau commented 4 years ago

FYI I've tagged astilectron with v0.34.0 and bumped both go-astilectron and go-astilectron-demo

Thank you very much