Closed leebenmorris closed 1 year ago
Hi. Thanks for your feedback. I'll gonna look at your problem as soon as I can.
Can confirm this bug exists in minimal example.
Setting "type": "module"
in package.json fixes the problem for me. Do you have one in your package.json?
This probably related issue: https://github.com/esbuild-kit/tsx/issues/239
Your module is compiled to cjs fi you don't have "type": "module"
and then when tsx runs your script - this error is thrown. formdata-node does not support commonjs, so you need to either add "type": "module"
to your package.json
, or stay on the v4. I'm gonna close this as wontfix, because I have no plan to add cjs back any time soon.
Also, Node.js 16 reached its EOL, so you can as well use Node.js' own FormData
implementation if you're targeting Node >= 18. Note that File
class is available since v20: https://nodejs.org/api/globals.html#class-file
v6 brings back CJS support and it's available now, check out release notes for more information: https://github.com/octet-stream/form-data/releases/tag/v6.0.0
Hi, I am trying to use v5.0.1 in my project.
When I run the script with TSX I get the following error:
v4 does not have this problem, and runs as expected.