Version: [email protected], [email protected]
I get a TS error using the code that appears in the documentation
Type 'Server' is missing the following properties from type 'Application': router, settings, resource, map, and 3 more.
I believe this is due to the type definition in ApolloServer.ts which defines the app member as an express.Application, but const app = express(); seems to be returning an express.Server object.
I'm happy to open a PR for this but the comments in the ApolloServer.ts file around this seem to indicate there are issues with changing the type definition here.
Or it's possible I'm just doing something wrong?
Any update on this? As it stands, I am unable to run the server using ts-node due to this error.
I had a bad @types/express dependency in my package.json. Once I fixed that, compilation worked as expected.
As @nozzle-a pointed out correctly, you probably installed npm install types/express --save-dev instead of npm install @types/express --save-dev.
Same issue. I had copied types/express from a doumentation / example online.
Most helpful comment
I had a bad
@types/expressdependency in my package.json. Once I fixed that, compilation worked as expected.