When calling Autobase.append, I receive an error that says "TypeError: Cannot read property 'length' of undefined".
Here's the full stack trace:
/path-to-project/node_modules/autobase/index.js:441
const head = await this._getInputNode(input, input.length - 1)
^
TypeError: Cannot read property 'length' of undefined
at Autobase.append (/path-to-project/node_modules/autobase/index.js:441:56)
at async file:///path-to-project/autobase-practice.js:17:1
Here's my code:
import Corestore from 'corestore'
import Autobase from 'autobase'
import ram from 'random-access-memory'
// Create two chat users, each with their own Hypercores.
// Here since we'll be rerunning the same code a lot, we'll use the ram storage
const store = new Corestore(ram)
const userA = store.get({ name: 'userA' })
const userB = store.get({ name: 'userB' })
// Make an Autobase with those two users as inputs.
const baseA = new Autobase([userA, userB], { input: userA })
const baseB = new Autobase([userA, userB], { input: userB })
await baseA.append('A0: hello!')
await baseB.append('B0: hi! good to hear from you')
await baseA.append('A1: likewise. fun exercise huh?')
await baseB.append('B1: yep. great time.')
// Let's print all messages in causal order
for await (const node of baseA.createCausalStream()) {
console.log(node.value.toString())
}
When calling
Autobase.append
, I receive an error that says "TypeError: Cannot read property 'length' of undefined".Here's the full stack trace:
Here's my code:
And here's my
package.json
: