Giter Club home page Giter Club logo

Comments (3)

kartikk221 avatar kartikk221 commented on June 4, 2024

Hey, would you be able to post the TypeScript errors logged when you try and use the express-jwt middleware? Thanks!

from hyper-express.

moiri avatar moiri commented on June 4, 2024

Sure, I get to following error:

Argument of type 'RequestHandler' is not assignable to parameter of type 'MiddlewareHandler'.
  Types of parameters 'req' and 'request' are incompatible.
    Type 'Request<DefaultRequestLocals>' is missing the following properties from type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>': accepted, host, route, signedCookies, and 48 more.

from hyper-express.

kartikk221 avatar kartikk221 commented on June 4, 2024

Hmm I see, it seems this has to do with HyperExpress not fully implementing all of the Typescript properties from ExpressJS. I would say for now, the unsafe cast you have may be the best option since you are just using the jwt middleware directly. If there was a problem with type errors when you are trying to custom logic within a middleware then It would make sense to make changes to the underlying types to reduce those errors.

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.