Giter Site home page Giter Site logo

I cant configure as a middleware about agendash HOT 7 CLOSED

agenda avatar agenda commented on August 15, 2024 6
I cant configure as a middleware

from agendash.

Comments (7)

RomainVernoux avatar RomainVernoux commented on August 15, 2024 5

If you're encountering this because you reuse your Mongoose connection, this worked for me:

const agenda = new Agenda({ mongo: mongoose.connection });
agenda._mdb.admin = () => agenda._mdb.db.admin();
const dashboard = Agendash(agenda);

The important part is that admin is not available in _mdb but in _mdb.db.

from agendash.

hariom282538 avatar hariom282538 commented on August 15, 2024 3

@lautarobock @alanhr @simison @alexkwolfe @loris

I'm also getting the same error

error: TypeError: agenda._mdb.admin is not a function
    at Agenda.<anonymous> (/node_modules/agendash/lib/agendash.js:18:17)

Fixed it by commenting : /node_modules/agendash/lib/agendash.js

// agenda._mdb.admin().serverInfo((err, serverInfo) => {
    //   if (err) {
    //     throw err;
    //   }
    //   if (!semver.satisfies(serverInfo.version, '>=2.6.0')) {
    //     console.warn('Agendash requires mongodb version >=2.6.0.');
    //   }
    // });

Agenda and Agendash both are working - see logs

info: Connected to MongoDB
info: Listening to port 3000
info: agenda is ready.
info: GET /dash 301 - 18.041 ms
info: GET /dash/ 200 - 16.431 ms
info: GET /dash/css/dashboard.css 200 - 10.017 ms
info: GET /dash/js/backbone-min.js 200 - 14.723 ms
info: GET /dash/js/lodash.min.js 200 - 10.859 ms
info: GET /dash/css/bootstrap.min.css 200 - 11.948 ms
info: GET /dash/js/jquery-2.2.0.min.js 200 - 11.088 ms
info: GET /dash/js/bootstrap.min.js 200 - 10.620 ms
info: GET /dash/js/moment.min.js 200 - 28.322 ms
info: GET /dash/js/main.js 200 - 13.614 ms
info: GET /dash/api 200 - 28.634 ms
info: GET /dash/api 304 - 5.640 ms
info: GET /dash/api 304 - 3.650 ms
info: GET /dash/api 304 - 5.134 ms
info: GET /dash/api 304 - 4.437 ms

from agendash.

koresar avatar koresar commented on August 15, 2024 1

Thanks @RomainVernoux
Your fix was incorporated into Agendash in #68.

from agendash.

alanhr avatar alanhr commented on August 15, 2024

Hey guys, any update about this ?

from agendash.

thibaultchazal avatar thibaultchazal commented on August 15, 2024

Thanks for the fix @hariom282538 !
It's working like a charm in development where I can comment Node Modules but how do you do in production ? I'm using Heroku and I don't know any way to do this trick there.

from agendash.

thibaultchazal avatar thibaultchazal commented on August 15, 2024

I see your pull request failed @hariom282538, how can I help solve the issue ?

from agendash.

hariom282538 avatar hariom282538 commented on August 15, 2024

@thibaultchazal Code merge check passed without any conflict, build job failed because of some other issues. Only agendas people can help us. Meanwhile clone this codebase makes changes as suggested by me earlier and push that to your private NPM repo. And use that while [npm install].
I used this - https://verdaccio.org/

from agendash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.