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

BUG - When bundled in ES module, cannot run on platforms other than win32 #83

Closed
vincesp opened this issue Sep 19, 2024 · 1 comment
Closed

Comments

@vincesp
Copy link

vincesp commented Sep 19, 2024

When bundled into an ES Module using rollup, the resulting code does not run on any platform other than win32. The following line yields an error:

(require != null && require("tty").isatty(1) && env.TERM !== "dumb") ||

Error:

                (require != null && require$$0$h.isatty(1) && env.TERM !== "dumb") ||
                 ^

ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '.../package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.

This expression is not evaluated on win32 as the previous line yields true then.

Node.js v20.17.0
picocolors v1.1.0

picocolors v1.0.0 is not affected by this bug.

@alexeyten
Copy link

duplicate #67

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

3 participants