-
Notifications
You must be signed in to change notification settings - Fork 12
Error: Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream #40
Comments
I downgraded node from 19.0.1 to 16.17.0 and it works 💯❤️ |
Does anybody know when it will be available for the 19+ NodeJS version? |
@andreisuharew We'll be happy to fix this for you -- we are actually not JS experts sadly. Can you share some code and how to reproduce the problem and we'll fix it ASAP |
i have exactly the same code example just in try catch . I tested node 17 also works fine . In 18 and 19 versions i see error about invalid data - same as in title of this issue |
You can simply try any of your example JS code on node 18+. Not sure why this is marked as closed since the issue is still very much present and downgrading node is not a solution but a workaround. |
I don't want to downgrade node, but see this: |
Please revisit this issue deepai team @deepai-org, I would love to use one of your endpoints in my application without downgrading node. The problem is related to how axios handles the FormData type, and some kind of change in that type in node 18. See axios/axios#5327 where the question was raised and axios/axios#5316 where it was resolved. I think the fix should be as simple as updating your axios dependency. |
I HAVE A WORKAROUND :) 🎉🎉 for anyone who comes across this thread I copied some of the code in the DeepAI.js file (https://github.com/deepai-org/deepai-js-client/blob/master/lib/core/DeepAI.js) into my own route. I am using the super resolution endpoint and passing an image url, so I put the following in my route:
And then you can access the output url at response.data.output_url. Obviously it's a pretty straightforward workaround—it's just hitting the api directly where the library fails. But it works because this route is using axios version 1.4.0, which is updated to handle the new FormData in node versions 18 and later. Of course the js client's axios dependency should still be updated. This workaround should be a temporary fix for those working in the new node versions. |
I'm getting this error on newly installed Ubuntu vps.
It is working fine on my old server
The error:
Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream
My code:
The text was updated successfully, but these errors were encountered: