go-astilectron-demo: Cannot find module main.js
I compile the application on Windows 10, that was successful.
$ ./output/windows-amd64/Astilectron\ demo.exe -v
2018/11/08 13:24:25 astilog: syslog is not implemented on this os, using stdout instead
{"level":"debug","msg":"Running app built at 2018-11-08 13:22:55.3468729 +0800 CST m=+3.828430301","time":"2018-11-08T13:24:25+08:00"}
{"level":"debug","msg":"Skipping restoring resources...","time":"2018-11-08T13:24:25+08:00"}
{"level":"debug","msg":"Starting...","time":"2018-11-08T13:24:25+08:00"}
{"level":"debug","msg":"Provisioning...","time":"2018-11-08T13:24:25+08:00"}
{"level":"debug","msg":"Astilectron has already been provisioned to version 0.29.0, moving on...","time":"2018-11-08T13:24:25+08:00"}
{"level":"debug","msg":"Electron has already been provisioned to version 1.8.1, moving on...","time":"2018-11-08T13:24:25+08:00"}
{"level":"debug","msg":"Listening...","time":"2018-11-08T13:24:25+08:00"}
{"level":"debug","msg":"Executing...","time":"2018-11-08T13:24:25+08:00"}
{"level":"debug","msg":"Starting cmd C:\\Users\\Caleb\\AppData\\Roaming\\Astilectron demo\\vendor\\electron-windows-amd64\\electron.exe C:\\Users\\Caleb\\AppData\\Roaming\\Astilectron demo\\vendor\\astilectron\\main.js 127.0.0.1:2234 false","time":"2018-11-08T13:24:25+08:00"}
{"level":"debug","msg":"Stdout says: \r","time":"2018-11-08T13:24:25+08:00"}
{"level":"debug","msg":"App has crashed","time":"2018-11-08T13:24:27+08:00"}
{"level":"debug","msg":"Stopping...","time":"2018-11-08T13:24:27+08:00"}
{"level":"debug","msg":"Closing...","time":"2018-11-08T13:24:27+08:00"}
{"level":"error","msg":"accept tcp 127.0.0.1:2234: use of closed network connection while TCP accepting","time":"2018-11-08T13:24:27+08:00"}
{"level":"debug","msg":"Stopping...","time":"2018-11-08T13:24:27+08:00"}
{"level":"fatal","msg":"running bootstrap failed: creating window failed: canceller.cancelled","time":"2018-11-08T13:24:27+08:00"}
Result (Error Message Box):
Error launching app
Unable to find Electron app at C:\Users\Caleb\AppData\Roaming\Astilectron demo\vendor\astilectron\main.js
Cannot find module 'C:\Users\Caleb\AppData\Roaming\Astilectron demo\vendor\astilectron\main.js'
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (7 by maintainers)
I was able to fix this with the following steps on MacOS:
Enable vendoring in go-astilectron-bundler and re-install it
cd $GOPATH/src/github.com/asticode/go-astilectron-bundler; dep init; cd astilectron-bundler; go install ./...
Enable vendoring in go-astilectron-demo and rebuild it
cd $GOPATH/src/github.com/asticode/go-electron-demo; dep init; rm bind.go; astilectron-bundler -v
I am now able to double-click on the created Mac App object in output/darwin and it runs as expected.
@weiyixuan mmmm this is weird. Can you do 2 things:
C:\Users\Caleb\AppData\Roaming\Astilectron demo\vendor\astilectron
and if they are files with content (size > 0)?C:\Users\Caleb\AppData\Roaming\Astilectron demo
and try again?Let me know how it goes.