max-mapper / max-mapper/dat-core

Executing "Usage Example" => Error: No dat here

Open
#26 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
42
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Do I need to pass in a leveldb?
The readme says something about

(default is require('leveldown'))

I do

var dat = require('dat-core')

var db = dat('./test')

db.put('hello', 'world', function (err) { // insert value 
  if (err) return handle(err) // something went wrong 
  db.get('hello', function (err, result) {
    if (err) return handle(err) // something went wrong 
    console.log(result)   // prints result 
    console.log(db.head) // the 'head' of the database graph (a hash) 
  })
})

// function handle (err) { console.error(err); }

and get

events.js:141
      throw er; // Unhandled 'error' event
            ^
Error: No dat here
    at /home/serapath/EXPERIMENTS/DAT_CORE/node_modules/dat-core/index.js:213:44
    at FSReqWrap.cb [as oncomplete] (fs.js:212:19)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the README's "Usage Example" using the shown dat-core code and inspect node_modules/dat-core/index.js around line 213, where the "No dat here" error is raised. Determine whether the example requires a LevelDB setup or has incorrect documentation, then verify that the documented example runs without the unhandled error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.