-
Notifications
You must be signed in to change notification settings - Fork 24
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
Cannot read property 'count' of undefined #18
Comments
My guess is this is related to a (poor) choice to change the DB driver in agenda. Seems like it might be a bit painful to fix. |
Do you have advice on what version of agenda should be used? |
You should be good with 0.6.8. You'll also need to use an older version of
|
Also having this issue |
+1 |
I have the same issue, and downgrading agenda to the older version doesn't work as well. |
agenda._db = agenda._collection; //add this line before passing agenda to agenda-ui |
@pavan612 thanks for trying to help. Tried it, but I'm still getting the error -
Agenda version 0.73 |
@harelba this is my working code |
var express = require('express');
var http = require('http');
var Agenda = require('agenda');
var agendaUI = require('agenda-ui');
var app = express();
var agenda = new Agenda({
db: {
address: 'localhost:27017/agenda-sample'
}
}, function (err) {
if (err) throw err;
console.log('Connected to database');
// Should add this code before setting middleware.
agenda._db = agenda._collection;
app.use('/agenda-ui', agendaUI(agenda, {poll: 1000}));
http.createServer(app).listen(9000, function () {
console.log('Express listeing on 9000 port');
});
}); Check #17 |
Thanks @pavan612 that hack worked :) |
Hi can you post sample code of your problem |
@pavan612 my code: var agenda = new Agenda({db: {address: configDB.url, collection: "agendaJobs"}});
agenda.name(os.hostname() + '-' + process.pid);
agenda.on('ready', function() {
agenda.every('30 seconds', 'Say the time', {time: new Date()});
agenda._db = agenda._collection;
agenda.start();
});
//some session stuff there
app.use('/agenda-ui', agendaUI(agenda, {poll: 1000}));
//... When I go to the the node terminal I have the same error with @FLYBYME and on the browser console the following: |
Thanks @pavan612 that hack worked 2 :) |
same as @geototti21 . |
For me the hacks doesn't works :-( |
So to get the hack to work and only init ui after agenda has connected to mongo I did this:
|
Tried all solutions, none worked 👎 |
I got Agendash working very quickly with no issues so far. https://github.com/joeframbach/agendash |
The text was updated successfully, but these errors were encountered: