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
'FormData' refers to a value, but is being used as a type here #1657
Comments
i'm not quite sure why this doesn't work any more. i'd really like to know, so i'd be glad if someone could help me find out. to me it seems as if the real culprit is formdata-polyfill which does not polyfill any of the types for FormData except the declaration that it exists and can be constructed - but then, how could it possibly have worked before? i noticed that adding the "dom" lib to tsconfig.json makes the compile error go away. as a workaround this might be good enough, but i'd very much prefer not pretending my node app has a full browser dom available... |
Trying to use
|
well.. with node 18 you'd probably not need node-fetch anyway. if they had types... DefinitelyTyped/DefinitelyTyped#60924 |
Yes, I am eagerly awaiting for the AWS Lambda runtime support for Node 18. In the meantime I'm thinking of reverting to an older |
The 'DOM' library includes type definitions for Usually we want to avoid using DOM (browser) type definitions in Node, because it's a completely separate environment. In this case it should be relatively safe because node-fetch's first feature in the README is that it "stays consistent with window.fetch API". |
Reproduction
Hi, I've got some issues with node-fetch v3.2.10 while trying to upgrade from v2.6.7 (tbf these issues appeared starting from v3.0.0).
When trying to compile typescript getting
Or
Expected behavior
I expect not to get any issue
Your Environment
Tried typescript v.4.7.4 and v4.8.4, both gets the same result
The text was updated successfully, but these errors were encountered: