You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there, I'm trying to upload a file with client.uploads.uploadFile(), and am seeing the error:
Cannot find module 'form-data'
The error happens when calling eval('require')('form-data')here.
This is the same issue that I ran into with #54, so it seems that the eval('require')('<library>') approach still breaks with my configuration for some reason, whether that's due to Vercel, ESM vs CJS, or something else. (Note that I tried installing form-data to my package.json, to no avail.)
It's probably wise to figure out what is going on at the root here, but I think a good immediate solution would be to drop the form-data library in favor of just using the FormData that has been built-in to Node.js since v18.
The eval('require') approach doesn't work in a Vercel environment, as discussed in #54. That PR was fixed by simply removing the library, which wasn't necessary. In this case, you can do the same thing, since the form-data library is no longer needed as of Node.js 18, since FormData is now built in with Node.
Could you please re-open this issue? The only way I'm able to use this library right now is by patching it to remove the call to eval('require')('form-data').
Hey there, I'm trying to upload a file with
client.uploads.uploadFile()
, and am seeing the error:The error happens when calling
eval('require')('form-data')
here.This is the same issue that I ran into with #54, so it seems that the
eval('require')('<library>')
approach still breaks with my configuration for some reason, whether that's due to Vercel, ESM vs CJS, or something else. (Note that I tried installingform-data
to mypackage.json
, to no avail.)It's probably wise to figure out what is going on at the root here, but I think a good immediate solution would be to drop the
form-data
library in favor of just using theFormData
that has been built-in to Node.js since v18.This would require dropping support for Node.js 16, but that has been end-of-life since September 2023, so this seems like a reasonable time to do so. Plus, Node.js 16 could still work with the
--experimental-fetch
flag.There are some other good reasons to drop
form-data
laid out in this issue: form-data/form-data#537What do you think?
The text was updated successfully, but these errors were encountered: