Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to work with ESM builds for nodejs env #23

Open
amalitsky opened this issue Dec 21, 2023 · 1 comment
Open

Doesn't seem to work with ESM builds for nodejs env #23

amalitsky opened this issue Dec 21, 2023 · 1 comment

Comments

@amalitsky
Copy link

amalitsky commented Dec 21, 2023

Since it is using deprecated Duplexer library, (with 15M weekly downloads btw) which has only CJS build to it.

Building my package with tsup (goes through fine) and trying to run the "binary", I get the following error message:

throw Error('Dynamic require of "' + x + '" is not supported');
        ^
Error: Dynamic require of "stream" is not supported

First line of duplexer's build is:

var Stream = require("stream")

And it is causing problems.

My ts config uses NodeNext as module and moduleResolution, and I have "type": "module" in package.json.

Once I drop gzip-size import from my code, all builds and works fine.

Let me know how I can help and thank you for the library! ❤️

Seemingly related issue with esbuild. I use tsup but these are similar tools.

@amalitsky
Copy link
Author

Added repository with reproduction of an issue I'm experiencing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant