Closed gimtwi closed 1 year ago
While there are a couple of things to try it's possible you are dealing with ts-node
having poor support for ESM, .mjs
and nodenext
/node16
mode:
https://github.com/TypeStrong/ts-node#native-ecmascript-modules
Try type checking the project using the real TypeScript CLI instead of ts-node
and see if it is able to compile ok. Perhaps using a command like this (going off memory, maybe check the CLI docs if I got this wrong):
tsc -p tsconfig.json --noEmit
If you still have the error, make sure all the documented TypeScript requirements are met:
Enable compilerOptions.allowJs
; that could be your problem.
It looks like you have not configured compilerOptions.maxNodeModuleJsDepth
, which can cause an error like your one.
I'm not sure, but maybe also try removing compilerOptions.skipLibCheck
.
Definitely don't install @types/graphql-upload
– graphql-upload
ships it's own types as TypeScript flavour JSDoc comments in the distributed .mjs
modules.
Closing because this isn't an actionable issue from my side, but feel free to comment if any of the suggestions above helped in your project.
You can try read post Nestjs Graphql uploads single, or multiple files into a Cloudinary it might help you
I'm using graphql-upload v. 16.0.2
Here is how I'm importing graphqlUploadExpress and other files:
import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.mjs";
Here is my package.json:
Here is my tsconfig.json:
No matter what I do, I still get the error. I tried just declare module with and without @types/graphql-upload installed, but application crushes with the same error, although I declared module/installed @types/graphql-upload.![Screenshot from 2023-01-27 14-45-50](https://user-images.githubusercontent.com/89921028/215101774-1b878d81-65f1-42c6-a946-46119ca27e14.png)
Has anyone faced this problem? What can I try next?