Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Won't open #5

Closed
19h opened this issue Oct 11, 2013 · 2 comments
Closed

Won't open #5

19h opened this issue Oct 11, 2013 · 2 comments

Comments

@19h
Copy link

19h commented Oct 11, 2013

    */node_modules/levelup/lib/levelup.js:103
      db.open(this.options, function (err) {
         ^
    TypeError: Cannot call method 'open' of undefined
        at LevelUP.open (*/node_modules/levelup/lib/levelup.js:103:6)
        at new LevelUP (*/node_modules/levelup/lib/levelup.js:73:8)
        at LevelUP (*/node_modules/levelup/lib/levelup.js:44:12)
        at worker (*:239:33)
        at Object.<anonymous> (*:690:2)
        at Module._compile (module.js:456:26)
        at Object.Module._extensions..js (module.js:474:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Function.Module.runMain (module.js:497:10)

Not sure if it's a recession, but it fails to open.

    require('levelup')("", {
        db: function(location) {
            return new require('memdown')(location)
        }
    });
@rvagg
Copy link
Member

rvagg commented Oct 11, 2013

yeah, I haven't bothered putting a self-instantiating constructor on MemDOWN, that's on my TODO, you have to actually instantiate it, see the docs:

factory = function (location) { return new MemDOWN(location) }

@rvagg
Copy link
Member

rvagg commented Oct 12, 2013

fixicated, your code should work fine now, in fact you should just have to do db: require('memdown') now.

@rvagg rvagg closed this as completed Oct 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants