holepunchto / hypercore

Hypercore is a secure, distributed append-only log.
https://docs.holepunch.to
MIT License
2.59k stars 182 forks source link

Uncaught TypeError: Cannot read property 'onmessage' of null #15

Closed ghost closed 8 years ago

ghost commented 8 years ago

In the browser with https://github.com/substack/spellcast I'm getting:

Uncaught TypeError: Cannot read property 'onmessage' of null

from this spot in lib/protocol.js:

https://github.com/mafintosh/hypercore/blob/master/lib/protocol.js#L320:

  if (handle.onmessage) handle.onmessage(type, message)
ghost commented 8 years ago

I get the original error when I do replication with { encrypted: false }. When I turn encryption back on, I get: Error: Channel is not open yet from https://github.com/mafintosh/hypercore/blob/master/lib/protocol.js#L294

mafintosh commented 8 years ago

i think this is fixed now. if not re-open