GithubHelp home page GithubHelp logo

Comments (5)

coler-j avatar coler-j commented on May 4, 2024

Can get around this by doing NestExpressApplication instead of INestAppliction or INestApplication<NestExpressApplication>

from nest.

micalevisk avatar micalevisk commented on May 4, 2024

so the "issue" is because app.getHttpServer() has any as the return type, right?

I guess that's because of the following change: cf4097c

now INestApplication has a type arg, which defaults to any

export interface INestApplication<TServer = any>

I'm not sure if we can improve that or if you just need to type that INestApplication better

from nest.

coler-j avatar coler-j commented on May 4, 2024

Well, how would I type the INestApplication better than doing INestApplication<NestExpressApplication>? I don't think there is anything else that would make sense in the context that it is being used.

i.e. the error occurs still with INestApplication<NestExpressApplication>

Edit:

Actually, a different error is encountered

image

from nest.

micalevisk avatar micalevisk commented on May 4, 2024

It should be: INestApplication<Server> where Server is from net (nodejs module)

Still, I'm not sure if we can improve the typings of createNestApplication but I'd suggest you to try to improve it.

So this is not a bug but a feature request

from nest.

kamilmysliwiec avatar kamilmysliwiec commented on May 4, 2024

Just pass <Server> as a type argument, as @micalevisk suggested above

When it comes to your ESLint rule, this isn't a bug (more explanation here nestjs/schematics#1700 (comment))

One thing we could improve is to mention this in the docs (if you have X rule enabled, then make sure to pass Server as a type argument).

from nest.

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.