-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use registerServer with Typescript and Apollo Server 2 #1140
Comments
Super odd, we have that in the test, which are typescript, here. What's inside of your tsconfig? Would love a PR with a failing test inside of the apollo-server package if you can manage! |
Yeah, it's very weird, because clicking into the definition takes me directly to ApolloServerBase 🤔. Full tsconfig.json: {
"compileOnSave": false,
"compilerOptions": {
"declaration": false,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"lib": ["es2015", "es2016"],
"module": "commonjs",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "dist/",
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "es5",
"typeRoots": ["./node_modules/@types", "./app/@types"]
},
"exclude": ["lib/editor"]
} Typescript 2.9.1. |
This should be fixed after #1161 |
I'm experiencing this issue with ^2.13.0 versions:
|
@timohermans Can you open a separate issue referencing this? |
Downgrading to
works for me. |
Not sure why downgrading constitutes it being closed - this fails when trying to use Apollo server version 2 - trying to pass express app into applyMiddleware
|
Same here.
Implementation:
Error:
|
Adding the object keys for applyMiddleware values solved it for me instead of
Do this (notice the object key-value pairs in the applyMiddleware object, not the just values)
package.json
|
For me, this was due to mismatched
|
@atkinchris's solution worked for me. Thanks for saving the day! |
I'm not sure if this is precisely that issue, but I definitely discovered in our app that some of the express-related DefinitelyTyped ( |
Worked for me! |
@atkinchris , solution worked. Thanks mate |
Following the documentation for Apollo Server 2, there are errors when using registerServer and Typescript
Gives the following error:
apollo-server 2.0.0-beta4
apollo-server-express 2.0.0-beta3
Temporary workaround is:
The text was updated successfully, but these errors were encountered: