pouchdb-auth icon indicating copy to clipboard operation
pouchdb-auth copied to clipboard

TypeError: Cannot read property 'to' of undefined

Open djupvikdigital opened this issue 7 years ago • 1 comments

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.

djupvikdigital avatar Jan 14 '18 14:01 djupvikdigital

This repository is about to be deprecated. I think this might be due to an outdated dependency. Probably best to try again after it is merged in the monorepo (+ released): https://github.com/pouchdb/pouchdb-server/pull/274

marten-de-vries avatar Jan 15 '18 22:01 marten-de-vries