-
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
Typescript Error after update to apollo-server-express 2.11.0 #3858
Comments
Same over here. Deleting |
Edit: resolved by upgrading
$ `yarn bin`/tsc
node_modules/apollo-server-core/node_modules/apollo-cache-control/dist/index.d.ts:24:9 - error TS2717: Subsequent property declarations must have the same type. Property 'cacheControl' must be of type '{ setCacheHint: (hint: CacheHint) => void; cacheHint: CacheHint; }', but here has type '{ setCacheHint: (hint: CacheHint) => void; cacheHint: CacheHint; }'.
24 cacheControl: {
~~~~~~~~~~~~
node_modules/apollo-cache-control/dist/index.d.ts:24:9
24 cacheControl: {
~~~~~~~~~~~~
'cacheControl' was also declared here.
Found 1 error.
$ yarn list --pattern apollo-server-express
yarn list v1.22.0
└─ [email protected]
✨ Done in 0.88s. |
@andreastoermer Could you try and confirm whether the suggestion by @chrislambe resolves it for you and close this if so? Thanks! |
@andreastoermer @bke-daniel Did you guys end up resolving this issue? I'm experiencing similar issues on version 2.12.0. |
@thenameisangel What is the output you receive when you run |
I can only fix the current problem, when I set SkipLibCheck to true in tsconfig. But that's only my workarround (and not a good one). When I set it to false, I get the error again (with 2.12.0) |
Adding |
@abernix I ran I tried @bke-daniel's suggestion of manually adding |
FYI I had the same issue updating from Fixed by installing @abernix Is it correct that apollo-server-core 2.13.1 references a lot of alpha dependencies?
|
@marcoreni Correct, due to the version bumps it needs to be |
Still an issue with 0.11.1? Using NestJS: |
Having the issue with 0.11.1. |
Also having the same issue: npm ls apollo-cache-control
[email protected] /Users/.../backend
├─┬ @nestjs/[email protected]
│ └─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
└─┬ [email protected]
└── [email protected] |
So TypeScript supports module augmentation and interface merging. It claims that:
But for some reason it thinks the additions to GraphQLResolveInfo in apollo-cache-control are not "the same type". I'm not sure if this is a TS bug or there's some good reason for this. When using prereleases of npm modules, it's a lot easier to end up with two versions of a module in your I don't feel great about this suggestion, but one thing that does work (if you're pretty sure that the prerelease of
to your app's tsconfig.json. ie, to tell it only to read the top-level ACC module no matter what. Not a compelling answer but it is working for my own app testing! |
I did the same thing as you I did the same thing as you, but this is just a temporary solution. I tried to install an apollo-cache-control and added a package.json configuration
"paths": {
"apollo-cache-control": [
"node_modules/apollo-cache-control"
]
} When i run:
But it is always ineffective. Do you have a good solution now? |
For what it's worth, the location of this Otherwise, I think this issue mostly just happens when there are alphas out, and using the tsconfig.json / paths trick does work, so I'm going to close this for now. |
|
Thanks, i was able to fix this from #3339 (comment) |
I update apollo-server-express package from 2.10.1 to 2.11.0 and during the build process of the application I get the following Typescript error message:
When I return back to version 2.10.1, everything is ok.
The text was updated successfully, but these errors were encountered: