Closed christianbundy closed 4 years ago
Got an error stack that's less ugly:
Error [TypeError]: Cannot read property 'close' of null
at Object.LAN.stop (/home/christianbundy/src/fraction/oasis/node_modules/ssb-lan/lib/index.js:83:35)
at Object.<anonymous> (/home/christianbundy/src/fraction/oasis/node_modules/secret-stack/util.js:80:17)
at Object.<anonymous> (/home/christianbundy/src/fraction/oasis/node_modules/hoox/index.js:3:17)
at Object.hooked [as stop] (/home/christianbundy/src/fraction/oasis/node_modules/hoox/index.js:10:15)
at Object.ConnScheduler.stop (/home/christianbundy/src/fraction/oasis/node_modules/ssb-conn/lib/conn-scheduler.js:134:132)
at Object.<anonymous> (/home/christianbundy/src/fraction/oasis/node_modules/secret-stack/util.js:80:17)
at Object.<anonymous> (/home/christianbundy/src/fraction/oasis/node_modules/hoox/index.js:3:17)
at Object.hooked [as stop] (/home/christianbundy/src/fraction/oasis/node_modules/hoox/index.js:10:15)
at CONN.stopScheduler (/home/christianbundy/src/fraction/oasis/node_modules/ssb-conn/lib/conn.js:145:36)
at Object.CONN.stop (/home/christianbundy/src/fraction/oasis/node_modules/ssb-conn/lib/conn.js:66:18)
Thanks for letting me know @christianbundy
First suspicion: are you absolutely sure that you have ssb-lan@0.2.0
and ssb-conn@0.15.1
? Because the line numbers mentioned in the stack trace don't quite match with the lib/*.js
files I have for those versions.
Further, the only use of close()
in ssb-lan is now guarded by an if
which should certainly protect us from Cannot read property 'close' of null
:
if (this.normalBroadcast) {
this.normalBroadcast.close();
this.normalBroadcast = void 0;
}
if (this.legacyBroadcast) {
this.legacyBroadcast.close();
this.legacyBroadcast = void 0;
}
In ssb-lan@0.1.4
, it didn't use to have those null checks, so I suspect you have 0.1.4
I don't know how to tell whether SSB-CONN is active
This would be a good API to have!
Oops, my code was updated to the latest versions but I was connecting to a server over MuxRPC that was using the older SSB-CONN. :man_facepalming:
Hi @staltz! I'm writing some small functionality for Oasis so that people can start/stop/restart their network activity from the CLI, but I'm bumping into a small error.
I don't know how to tell whether SSB-CONN is active, so I never know whether I should show the 'start' or 'stop' buttons. This means that I'm showing both buttons, but if you hit 'stop' twice then SSB-LAN throws this error:
Here are the versions being used: