dwolla-v2-node icon indicating copy to clipboard operation
dwolla-v2-node copied to clipboard

@types/node-fetch should be a dependency

Open rdsedmundo opened this issue 3 years ago • 2 comments

I'm getting cannot find name Headers because the type definitions of dwolla-v2 are referencing this interface as if it were available globally.

Another option is upgrading node-fetch to v3 as it includes the TS definitions built-in.

rdsedmundo avatar Oct 08 '21 10:10 rdsedmundo

~Seems strange that Response is defined but Headers is not.~

~In addition to either of the suggested fixes, we should remove the custom interface for Response altogether. That should be coming from node-fetch.~

Edit: Just realized handleResponse in Token.js is creating a custom response object. I'd advocate for renaming Response to something like ParsedResponse to avoid confusion with the Response type that will be coming from node-fetch.

pting-me avatar Feb 13 '22 16:02 pting-me

This is no longer an issue in Node.js 18 as this interface is actually available in the global namespace, as part of the native fetch support. I'll leave up to you whether or not you should support older versions of Node.js and thus keep the issue open.

rdsedmundo avatar Feb 10 '23 18:02 rdsedmundo