-
Notifications
You must be signed in to change notification settings - Fork 106
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
Types error in index.d.ts for nodejs #35
Comments
I'm not familiar with Typescript but I think fetch, Request, Response and Headers are supposed to be global types, aren't they? In my VSCode, there's no such warning. |
Closing this since there was no answer. |
@lquixada please reopen. I have the same error as @KyloJorgensen. I don't think those are global types. I don't see them defined in the node type definitions at least.
|
hey @esetnik, can you try going to your tsconfig.json > compilerOptions > libs and add "dom" to the list? |
I was seeing the same issue - Adding |
I don't think |
@esetnik you're right! however, if you follow the the fetch, Request, Response and Header declaration inside the lib.dom.d.ts, you'll realize that those are very deeply nested declarations. Unfortunately, there's no easy way to extract and maintain them. It would be needed a lot of copy and paste and it would be hard to keep track of any update. In my opinion, having a single source of truth (the lib.dom.d.ts in this case) is more valuable than saving a few kilobytes that users would not have to download anyway. |
usesing vscode to write nodejs server code
The text was updated successfully, but these errors were encountered: