replicate/replicate-javascript

TransformStream is not defined

basedwon opened this issue · 3 comments

I just installed the package and tried to require it and got this error. I'm on Node 16.20.0. I saw in the readme that these were "bundled", I'm not exactly sure what that means or if I'm supposed to do something more; that's not clear from the docs.

mattt commented

Hi @basedwon. This library requires Node.js >= 18. Please update to a newer version of Node and let us know if you still see this error.

Hi @mattt, I actually can't upgrade currently unfortunately. So, I guess I can't use your API, unless I can just do axios requests directly. Probably would be good to mention that requirement in the docs.

aron commented

Depending on how your app is configured, you could look into using something like https://www.npmjs.com/package/web-streams-polyfill, this would provide the TransformStream API in your application. Note that you may still then run into other issues with Node version compatibility.

Probably would be good to mention that requirement in the docs.

We'll get that added to the README.