feathersjs-ecosystem / feathers-sync

Synchronize service events between Feathers application instances
MIT License
222 stars 41 forks source link

TypeError: Cannot read property 'split' of undefined #6

Closed cloudlena closed 8 years ago

cloudlena commented 8 years ago

The library runs into a problem when I configure it as it's described in the example. My configuration is the following:

app.configure(sync('redis', { db: 'localhost:6379' }));

When trying to execute this code, I'm getting the error: TypeError: Cannot read property 'split' of undefined for the following line:

var proto = config.db.split('://')[0];

in file src/sync.js of the package.

This is because the variable config, at this point just contains the string "redis".

I'm guessing that we need to change the readme to use

.configure(sync({
    db: 'mongodb://localhost:27017/sync',
    collection: 'events'
  }))

and remove the "adapter" part of the Arguments section.

daffl commented 8 years ago

It looks like the Readme has been fully updated yet but if you check out the tests at https://github.com/feathersjs/feathers-sync/blob/master/test/redis.js#L5 you will see that it expects the Redis URL in the form of redis://localhost:6379.

cloudlena commented 8 years ago

This issue can be closed :)