go-astilectron-demo icon indicating copy to clipboard operation
go-astilectron-demo copied to clipboard

TypeError: Cannot read property 'requestSingleInstanceLock' of undefined

Open juwell opened this issue 2 years ago • 0 comments

when i try debug this demo in vscode(no modify), i got this error, but it works well by using astilectron-bundler command

I don't know what happened, please give me some help, thank you ~

env: macOS Monterey, golang 1.17.9

the full error info:

Starting: /Users/somebody/Documents/base_env/gopath/bin/dlv dap --check-go-version=false --listen=127.0.0.1:56581 --log-dest=3 from /Users/somebody/Documents/other/go-astilectron-demo
DAP server listening at: 127.0.0.1:56581
2022/05/09 12:19:21 Running app built at
2022/05/09 12:19:21 astikit: starting worker...
2022/05/09 12:19:21 astikit: received signal urgent I/O condition
2022/05/09 12:19:21 astikit: received signal urgent I/O condition
2022/05/09 12:19:21 astikit: received signal urgent I/O condition
2022/05/09 12:19:21 Skipping restoring resources...
2022/05/09 12:19:21 Starting...
2022/05/09 12:19:21 Provisioning...
2022/05/09 12:19:21 Astilectron has already been provisioned to version 0.49.0, moving on...
2022/05/09 12:19:21 Electron has already been provisioned to version 11.4.3, moving on...
2022/05/09 12:19:21 Listening...
2022/05/09 12:19:21 Executing...
2022/05/09 12:19:21 Starting cmd /Users/somebody/Documents/other/go-astilectron-demo/vendor/electron-darwin-amd64/Electron.app/Contents/MacOS/Electron /Users/somebody/Documents/other/go-astilectron-demo/vendor/astilectron/main.js 127.0.0.1:56590 true
2022/05/09 12:19:21 Stderr says: /Users/somebody/Documents/other/go-astilectron-demo/vendor/astilectron/main.js:15
2022/05/09 12:19:21 Stderr says:   const singlesInstanceLock = app.requestSingleInstanceLock();
2022/05/09 12:19:21 Stderr says:                                   ^
2022/05/09 12:19:21 Stderr says: 
2022/05/09 12:19:21 Stderr says: TypeError: Cannot read property 'requestSingleInstanceLock' of undefined
2022/05/09 12:19:21 Stderr says:     at Object.<anonymous> (/Users/somebody/Documents/other/go-astilectron-demo/vendor/astilectron/main.js:15:35)
2022/05/09 12:19:21 Stderr says:     at Module._compile (internal/modules/cjs/loader.js:1152:30)
2022/05/09 12:19:21 Stderr says:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
2022/05/09 12:19:21 Stderr says:     at Module.load (internal/modules/cjs/loader.js:992:32)
2022/05/09 12:19:21 Stderr says:     at Module._load (internal/modules/cjs/loader.js:885:14)
2022/05/09 12:19:21 Stderr says:     at Function.f._load (electron/js2c/asar_bundle.js:5:12633)
2022/05/09 12:19:21 Stderr says:     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
2022/05/09 12:19:21 Stderr says:     at internal/main/run_main_module.js:17:47
2022/05/09 12:19:21 '/Users/somebody/Documents/other/go-astilectron-demo/vendor/electron-darwin-amd64/Electron.app/Contents/MacOS/Electron' exited with code: 1
2022/05/09 12:19:21 App has crashed
2022/05/09 12:19:21 astikit: received signal child exited
2022/05/09 12:19:21 Stopping...
2022/05/09 12:19:21 astikit: stopping worker...
2022/05/09 12:19:21 Closing...
2022/05/09 12:19:21 accept tcp 127.0.0.1:56590: use of closed network connection while TCP accepting
2022/05/09 12:19:21 running bootstrap failed: creating window failed: context canceled
Process 40279 has exited with status 1
dlv dap (40258) exited with code: 0

my vscode launch.json is :

{
"version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}"
        }
    ]
}

juwell avatar May 10 '22 04:05 juwell