-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Number of TypeScript type errors #1617
Comments
Hey! for what i have seen, this is mostly problem of the "fetch-blob" package. I dont know if it's because "node-fetch" is using deprecated packages, or because it's still an issue in the dependendcies. But the quick fix may be to ignore those errors or files in the compiler options. |
These errors actually started with version |
I think it was caused by bcfb71c, since https://github.com/jimmywarting/FormData/blob/master/esm.min.d.ts doesn't export the type properly, and tsc doesn't know that it should also generate types here: https://github.com/node-fetch/fetch-blob/blob/main/package.json#L20. |
I'm also experiencing this.... Any pathway to a fix? |
@yo1dog: would you consider reverting your commit? |
I have no control over the repo. I made my PR nearly a year ago (Sep 2021). Back then there was no issue. I believe 81b1378 from Jan 2022 is what is conflicting. I guess no one tested it again a year later before merging it in? If node-fetch aims to be pollyfill for node, it needs to provide a polyfill for the types as well. BTW, |
Reverting to |
But |
Adding "DOM" to tsconfig.json also works as a temporary workaround {
"compilerOptions": {
...
"lib": ["es2017", "esnext.asynciterable", "DOM"],
...
}
} |
Adding in some noise to say I've also ran into this issue. Not only when using node-fetch, but also affects isomorphic-unfetch. going to revert to 3.2.8 as a solve since it's a one-liner. |
Also experiencing this. Had to downgrade to 3.2.8 as well. Is there any plan to fix? |
A better approach than adding
Note that |
I'm still getting this in 3.3.2. |
Same. |
This fails with
for me |
This did work for me with 3.3.2 |
node-fetch causing issues when upgrading node-fetch/node-fetch#1617
Is there someone currently addressing this issue? I've also encountered it, and it seems to have been persistent for some time. I'm looking for a permanent fix for this issue. |
Reproduction
Steps to reproduce the behavior:
yarn install node-fetch
(3.2.10
)tsc -p tsconfig.json --noEmit
My
tsconfig.json
looks like this:Expected behavior
There should be no type errors
Screenshots
Your Environment
3.2.10
16.16.0
1.22.19
4.7.4
Additional context
The text was updated successfully, but these errors were encountered: