question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Final Typescript Support

See original GitHub issue

Hey There, first of all I’m really thankful for this library.

I’m using it since a long time now. Since the world seems to switch to esm i would do so too. But unfortunately since this moment this library does not work anymore.

I’m using it along with type-graphql so i really really need types without that i’m not able to upload files. Of course I’ve already added an issue over there to make sure i will find a solution.

Nevertheless…

While importing the files image

Could not find a declaration file for module 'graphql-upload/Upload.mjs'. 'node_modules/graphql-upload/Upload.mjs' implicitly has an 'any' type.

This is my tsconfig.json

{
  "compilerOptions": {
    "allowJs": true,
    "baseUrl": ".",
    "declaration": true,
    "declarationMap": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "lib": ["es2018", "esnext.asynciterable"],
    "module": "esnext",
    "moduleResolution": "nodenext",
    "outDir": "build",
    "removeComments": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "sourceMap": true,
    "strict": true,
    "target": "es2018"
  },
  "include": ["source"],
  "exclude": ["build"]
}

Maybe I’m doing something wrong but i really don’t know what.

I read along alot of issues about this topic and it seems that a lot of people feel with me. For me this is a really hard situation because without types in such a central part of my application it feels like no good deal to me using this library. It’s not possible to me, to change my typescript configuration to commonjs to make a single library work.

I can really understand that maintaining a library as famous as this one is a real hard thing. And i’m really thankful that you’ve spend so much time creating this library.

While reading i did not really get the point of not using typescript here. Wouldnt it be much easier to do it in Typescript since there are so much people out there using it?

So i have at least two Questions.

Will there ever be proper types for this package ? If not is there a package which you might know solving my problems uploading Files with proper typings.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Tjerk-Haaye-Henricuscommented, Oct 24, 2022

Yes i will keep you updated in case someone is using type-graphql as i do 😃 Thanks again for the support 🙏

0reactions
jaydensericcommented, Oct 24, 2022

You’re welcome 😃

do you have an idea why type-graphql cannot infer graphql types from that library anymore ?

I’m not the best person to ask; I don’t use or maintain type-graphql.

Closing because there doesn’t appear to be anything to action here in this repo; if something comes up during the investigation in https://github.com/MichalLytek/type-graphql/issues/1372 that should be actioned here we can reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Final keyword in typescript? - Stack Overflow
"TypeScript now supports using 'let' and 'const' in addition to 'var'. These currently require the ES6 output mode, but we're are ...
Read more >
Support final methods #33446 - microsoft/TypeScript - GitHub
If someone can provide the stats for final methods, please help =( Interestingly enough, searching Github shows that sealed/final class is used ...
Read more >
TypeScript: JavaScript With Syntax For Types.
TypeScript is JavaScript with syntax for types. TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at ......
Read more >
Documentation - TypeScript 4.9
TypeScript 4.9 supports an upcoming feature in ECMAScript called auto-accessors. Auto-accessors are declared just like properties on classes, ...
Read more >
Documentation - TypeScript 4.3
Separate Write Types on Properties. In JavaScript, it's pretty common for APIs to convert values that are passed in before storing them.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found