hypercore-protocol / hyperdrive-daemon

Hyperdrive, batteries included.
MIT License
156 stars 23 forks source link

Daemon Crash: Cannot access 'prefix' before initialization #38

Closed pfrazee closed 4 years ago

pfrazee commented 4 years ago

I managed to trigger this one by checking out a drive at version=1 and then trying to read some files.

ReferenceError: Cannot access 'prefix' before initialization
    at Get.onnode [as _callback] (/Users/paulfrazee/.nvm/versions/node/v12.16.1/lib/node_modules/hyperdrive-daemon/node_modules/hypertrie/lib/iterator.js:53:19)
    at Get._update (/Users/paulfrazee/.nvm/versions/node/v12.16.1/lib/node_modules/hyperdrive-daemon/node_modules/hypertrie/lib/get.js:50:26)
    at onhead (/Users/paulfrazee/.nvm/versions/node/v12.16.1/lib/node_modules/hyperdrive-daemon/node_modules/hypertrie/lib/get.js:38:10)
    at onheadseq (/Users/paulfrazee/.nvm/versions/node/v12.16.1/lib/node_modules/hyperdrive-daemon/node_modules/hypertrie/lib/get.js:27:22)
    at HyperTrie.headSeq (/Users/paulfrazee/.nvm/versions/node/v12.16.1/lib/node_modules/hyperdrive-daemon/node_modules/hypertrie/index.js:149:36)
    at Get._start (/Users/paulfrazee/.nvm/versions/node/v12.16.1/lib/node_modules/hyperdrive-daemon/node_modules/hypertrie/lib/get.js:23:12)
    at new Get (/Users/paulfrazee/.nvm/versions/node/v12.16.1/lib/node_modules/hyperdrive-daemon/node_modules/hypertrie/lib/get.js:18:8)
    at HyperTrie.get (/Users/paulfrazee/.nvm/versions/node/v12.16.1/lib/node_modules/hyperdrive-daemon/node_modules/hypertrie/index.js:215:10)
    at Iterator._open (/Users/paulfrazee/.nvm/versions/node/v12.16.1/lib/node_modules/hyperdrive-daemon/node_modules/hypertrie/lib/iterator.js:48:27)
    at Iterator.NanoIterator.next (/Users/paulfrazee/.nvm/versions/node/v12.16.1/lib/node_modules/hyperdrive-daemon/node_modules/nanoiterator/index.js:31:26)
pfrazee commented 4 years ago

Only seems to happen when version=1. At 2+, no problem.

mafintosh commented 4 years ago

Hypertrie issue. Fixed in 4.7.1 there