Skip to content

TypeError: Object.defineProperties called on non-object #166

@matteocrippa

Description

@matteocrippa

Using the latest version from npm i'm experiencing this issue when I connect to a local db and I try to create a database.

Here the code used:

db.exists(function(error, exists){
if(error)
 console.log(error);
else if (exists)
 console.log("ok");
else{
db.create();
db.save('_design/test',{
  all: { 
   map: function(doc){
    if(doc.name) emit(doc.name, doc);
   }
}
});

Running this code once I receive this error:

/node_modules/cradle/lib/cradle/response.js:126
return Object.defineProperties(obj, descriptor);
^
TypeError: Object.defineProperties called on non-object
at Function.defineProperties (native)
at Object.extend (/node_modules/cradle/lib/cradle/response.js:126:19)
at Request._callback (/node_modules/cradle/lib/cradle.js:187:18)
at Request.callback (/node_modules/cradle/node_modules/request/main.js:119:22)
at Request. (native)
at Request.emit (events.js:70:17)
at Request. (/node_modules/cradle/node_modules/request/main.js:521:16)
at Request.emit (events.js:67:17)
at IncomingMessage. (/node_modules/cradle/node_modules/request/main.js:483:14)
at IncomingMessage.emit (events.js:88:20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions