-
Notifications
You must be signed in to change notification settings - Fork 48
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
cjs export is broken when importHelpers is set to true in tsconfig on consumer side #53
Comments
Import statements only work in esm modules (if you have const bs58 = require("bs58").default;
bs58.encode(Buffer.from("test", "utf8")); |
in typescript the error persists if using cjs and require pattern is not desired |
@arijoon can you share minimal working reproduction? You can import CJS modules using ESM syntax |
Sure I'll make a repo later in the week with reproduction. Using
For now I've reverted to v5 which does not have this issue |
What is the NodeJS version? Are you using external tools like bun or deno or something? Even though bs58 is marked as an ESM, it contains the require exports for CJS inside package.json... so something in your build pipeline is so old that it can't comprehend the exports key of package.json... We can look into this when you give us a small repository to try it out with. |
Repository to reproduce the issue: https://github.com/arijoon/bs58-53 |
@Nesopie Said he'll work on it. |
Thanks, there's also a |
For ex:
Both code snippets fails with error:
encode is not a function
The text was updated successfully, but these errors were encountered: