-
Notifications
You must be signed in to change notification settings - Fork 53
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
[colorette v1.4] tty && tty.isatty(1)
breaks in vite HMR mode
#67
Comments
tty && tty.isatty(1)
breaks in vite HMR modetty && tty.isatty(1)
breaks in vite HMR mode
Thanks. How would I go about reproducing your environment to test this myself? |
what happens: |
Gotcha, thanks! I believe updating to the latest Colorette should fix it. |
|
Hi!
In vite HMR mode,
require('tty')
returns a mock module, which is auto-defined as:Therefore, the check
tty && tty.isatty(1)
(isCompatibleTerminal
) fails with "TypeError: tty.isatty is not a function".I can't help by disabling via
process.env.NO_COLOR
, becauseisCompatibleTerminal
is eagerly evaluated, no matter ifNO_COLOR
is set or not.Could you please consider:
process.env.NO_COLOR
is set.isCompatibleTerminal
only after checking for!isDisabled
.Thank you!
The text was updated successfully, but these errors were encountered: