Giter Site home page Giter Site logo

Comments (5)

ryanpierre avatar ryanpierre commented on August 14, 2024

This was resolved by checking out an older state of my app, then checking master back out 🤔

from overnight.

tomgelu avatar tomgelu commented on August 14, 2024

I have this issue too with 1.7.2. Checking out older states dont solve this.
I'll stay in 1.6.15.

from overnight.

seanpmaxwell avatar seanpmaxwell commented on August 14, 2024

Hey @joeykilpatrick Sorry to keep calling you but this is due to another change in your pull request and I think it's helpful to point it out.

This change right here on line 156:

let callBack: (...args: any[]) => any = controller[member];

is what was causing 'this' to be undefined. I reverted it back to:

let callBack = (req: Request, res: Response, next: NextFunction) => {
    return controller[member](req, res, next);
};

Please test all methods in the Sample Project before doing pull-requests. Everyone version 1.7.3 should fix this issue.

from overnight.

joeykilpatrick avatar joeykilpatrick commented on August 14, 2024

Sorry @seanpmaxwell for this one, but reverting reopens #42, and causes tests to fail. Note that the actual method (callback) does not have to be of that type and can have an unlimited number of arguments of any type if a wrapper is used. The following change will fix the issue.

let callBack: (...args: any[]) => any = (...args: any[]): any => {
    return controller[member](...args);
};

I'm sorry that my pull request had these side effects. Without tests for the sample project, it is difficult to know what will break when additional code is written. This is a great library, but not having any tests makes it impossible to contribute without issues like this.

I can submit a pull request for the code above and an additional test for this behavior, but if you would rather I not make any more changes, please let me know. I really like this library and use it for some personal projects, but if you do not want any further contributions from me, then I will understand.

from overnight.

seanpmaxwell avatar seanpmaxwell commented on August 14, 2024

@joeykilpatrick v1.7.4 has this change

from overnight.

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.