Orbit-db: ACCESS ERROR: TypeError: Cannot read property 'toString' of undefined

Created on 19 Jan 2019  Â·  2Comments  Â·  Source: orbitdb/orbit-db

Module versions
ipfs: "^0.34.0",
orbit-db: "^0.19.9"
nodejs: "v8.12.0"
npm: "6.4.1"

How to recreate error?

const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')


const ipfsOptions = {
  'EXPERIMENTAL': {
    'pubsub': true
  }
}

// Create IPFS instance
const ipfs = new IPFS(ipfsOptions)

ipfs.on('error', (e) => console.error(e))
ipfs.on('ready', async () => {
  const orbitdb = new OrbitDB(ipfs)

  // Create / Open a database
  const db = await orbitdb.kvstore('hello')
  await db.load()

})

Stack Trace

Swarm listening on /ip4/127.0.0.1/tcp/4002/ipfs/Qmbf3mgNDGM7wC4Q1wJvtddd4Ed8GxVEixzFZzi3o5ovY8
Swarm listening on /ip4/192.168.43.249/tcp/4002/ipfs/Qmbf3mgNDGM7wC4Q1wJvtddd4Ed8GxVEixzFZzi3o5ovY8
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/ipfs/Qmbf3mgNDGM7wC4Q1wJvtddd4Ed8GxVEixzFZzi3o5ovY8
ACCESS ERROR: TypeError: Cannot read property 'toString' of undefined
    at IPFSAccessController.save (/home/vasa/Desktop/Pet_projects/clusterlabs/scribble/node_modules/orbit-db/src/ipfs-access-controller.js:31:36)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
(node:30975) UnhandledPromiseRejectionWarning: TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.join (path.js:1236:7)
    at createDBManifest (/home/vasa/Desktop/Pet_projects/clusterlabs/scribble/node_modules/orbit-db/src/db-manifest.js:8:28)
    at OrbitDB.create (/home/vasa/Desktop/Pet_projects/clusterlabs/scribble/node_modules/orbit-db/src/OrbitDB.js:250:32)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
(node:30975) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:30975) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Is there something wrong with the module, or am I doing something wrong?

Most helpful comment

As @maht0rz said in #543 : For those looking to continue with the examples / getting started - install [email protected] as a ‘temporary workaround’

npm install [email protected]

All 2 comments

As @maht0rz said in #543 : For those looking to continue with the examples / getting started - install [email protected] as a ‘temporary workaround’

npm install [email protected]

Cool, it works!
Closing the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eusthace picture eusthace  Â·  6Comments

MirceaKitsune picture MirceaKitsune  Â·  3Comments

huhsame picture huhsame  Â·  4Comments

oed picture oed  Â·  5Comments

whyrusleeping picture whyrusleeping  Â·  3Comments