Skip to content
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

Could not find a declaration file for module 'graphql-upload' #2092

Closed
samalexander opened this issue Dec 13, 2018 · 9 comments
Closed

Could not find a declaration file for module 'graphql-upload' #2092

samalexander opened this issue Dec 13, 2018 · 9 comments
Labels
🪲 bug 🚀 shipped 🧬 typings Relates to TypeScript changes or improvements.
Milestone

Comments

@samalexander
Copy link

Using apollo-server-express v2.3.0 in a Typescript project produces the following error due to missing typings for the graphql-upload module.

node_modules/apollo-server-core/dist/processFileUploads.d.ts:1:49 - error TS7016: Could not find a declaration file for module 'graphql-upload'. 'node_modules/graphql-upload/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/graphql-upload` if it exists or add a new declaration (.d.ts) file containing `declare module 'graphql-upload';`

1 declare const processFileUploads: typeof import('graphql-upload').processRequest | undefined;
@simon-holm
Copy link

I have nothing helpful to add, but we have the same issue when we tried to re-deploy our server just now.

@Alexloof
Copy link

Temp solution until they have fixed it:

declare module 'graphql-upload' {
export function processRequest(
request: any,
response: any,
options?: any
): Promise
}

@onehorsetown
Copy link

Depending on your compiler settings, you might need:

declare module 'graphql-upload' {
  export function processRequest<T>(
    request: any,
    response: any,
    options?: any
  ): Promise<T>;
}

otherwise, you get this:

@types/vendor.d.ts(15,6): error TS2314: Generic type 'Promise<T>' requires 1 type argument(s)

@apoloa
Copy link

apoloa commented Dec 13, 2018

This is happening in version 2.1.0 too. And breaks all compilation in the code for this version that uses typescript. The package graphql-upload disappears from the npm.

@abernix abernix added 🧬 typings Relates to TypeScript changes or improvements. 🪲 bug 🚀 shipped ✋ blocking Prevents production or dev due to perf, bug, build error, etc.. labels Dec 13, 2018
@abernix
Copy link
Member

abernix commented Dec 13, 2018

Thanks for reporting this!

Please give 2.3.1 (just published) a try and see if that resolves the problem for you! This certainly supports my belief that integration tests which better test the consumption of Apollo Server would be a welcome addition to this repository.

@apoloa This particular error is certainly something new and reproducible which I wasn't seeing before. That said, sharing the specific error could be helpful because graphql-upload was not used in this project at that time (it was still apollo-upload-server, before 2.3.0.).

@samalexander
Copy link
Author

@abernix v2.3.1 fixes the issue. Thanks!

@abernix abernix added this to the 2.3.1 milestone Dec 14, 2018
@apoloa
Copy link

apoloa commented Dec 14, 2018

@abernix I will check which are the specific version that npm downloads.

@abernix abernix removed the ✋ blocking Prevents production or dev due to perf, bug, build error, etc.. label Sep 3, 2019
@rebazomar121
Copy link

@onehorsetown
can you tell me where I put this code ... which setting?

@scott-lc
Copy link

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🪲 bug 🚀 shipped 🧬 typings Relates to TypeScript changes or improvements.
Projects
None yet
Development

No branches or pull requests

8 participants