Skip to content

TypeError: Cannot read property 'to' of undefined #44

@djupvikdigital

Description

@djupvikdigital

Using pouchdb-auth with pouchdb-adapter memory fails for me with the error Security methods already installed. However while digging deeper it turns out that the real error is this:

    TypeError: Cannot read property 'to' of undefined
      
      at installWrappers (node_modules/pouchdb-wrappers/index.js:48:29)
      at Object.<anonymous>.exports.installWrapperMethods (node_modules/pouchdb-wrappers/index.js:39:3)
      at PouchDB$2.Object.<anonymous>.exports.installSecurityMethods (node_modules/pouchdb-system-db/node_modules/pouchdb-security/index.js:32:12)
      at Object.<anonymous>.exports.installSystemDBProtection (node_modules/pouchdb-system-db/index.js:25:35)
      at node_modules/pouchdb-auth/lib/index.js:67:16

This happens when the function getBaseAndName is called with the name parameter set to "replicate.to". The property replicate is not set on the base object, causing the function to return an object with base set to undefined.

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