Giter Club home page Giter Club logo

Comments (2)

kartikk221 avatar kartikk221 commented on May 24, 2024 1

This bug has been fixed in v6.4.5. Your assumption was correct, this bug would occur because HyperExpress calculates and caches all middlewares each route has to go through into the options.middleware property internally for faster runtime performance as we only have to chain through a 1D array before calling the route handler. The problem was that the object would be directly modified, so I have now added a line to make an Object.assign copy of the provided options object and also added a test to ensure the provided options object remains immutable after route creation.

from hyper-express.

BobbyWibowo avatar BobbyWibowo commented on May 24, 2024

I cannot replicate this behavior on HyperExpress v6.4.2

My brain hurts, is there some evil spirit playing tricks on my codes or something
I posted this after testing like about 6 times to make sure it did indeed work on v6.4.2, but after I posted this and tried again, it decided to break, lmfao
Needless to say the stacktrace is different in v6.4.2, but yeah..

TypeError: trigger is not a function
    at Route.handle (/home/bobby/src/safe.fiery.me/node_modules/hyper-express/src/components/router/Route.js:82:28)
    at iterator (/home/bobby/src/safe.fiery.me/node_modules/hyper-express/src/components/router/Route.js:72:24)
    at /home/bobby/src/safe.fiery.me/controllers/middlewares/RateLimiter.js:47:16

And I've edited the original post with the actual cause after investigating further

from hyper-express.

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.