Open TobiasHeidingsfeld opened 5 years ago
It seems --enable-vm-service=8181 should do as this is the port that is hard coded but it also fails with the same error
Same problem for me on Ubuntu:
Paths ./bin/server.dart changed!
Reloading the application...
Unhandled exception:
SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 49406
#0 vmServiceConnectUri (package:vm_service_lib/vm_service_lib_io.dart:20:22)
<asynchronous suspension>
#1 HotReloader.reload (package:jaguar_hotreload/src/jaguar_hotreload_base.dart:350:23)
<asynchronous suspension>
#2 new HotReloader.<anonymous closure> (package:jaguar_hotreload/src/jaguar_hotreload_base.dart:124:13)
<asynchronous suspension>
....
It works when I use this snippet (posted by @mindplay-dk on gitter) instead of the one shown in this lib's docs:
if (HotReloader.isHotReloadable) {
var info = await dev.Service.getInfo();
var uri = info.serverUri;
uri = uri.replace(path: path.join(uri.path, 'ws'));
if (uri.scheme == 'https') {
uri = uri.replace(scheme: 'wss');
} else {
uri = uri.replace(scheme: 'ws');
}
print('Hot reloading enabled');
final reloader = HotReloader(vmServiceUrl: uri.toString());
await reloader.addPath('.');
await reloader.go();
}
Please submit a PR.
When running with
final reloader = new HotReloader(); reloader.addPath('.'); await reloader.go();
with --enable-vm-service=1 args the following error occures:
Exception has occurred. SocketException (SocketException: OS Error: The remote computer refused the network connection. , errno = 1225, address = localhost, port = 54394)