jorgebucaran/colorette

tty.isatty is not a function

from-nibly opened this issue · 2 comments

I'm using sanitize-html in the browser which uses postcss which uses this.

When postcss imports collorette it fails on the line checking for isCompatibleTerminal

A quick fix would be to switch to the following by adding a check that tty.isatty exists before calling it.

const isCompatibleTerminal =
  tty && tty.isatty && tty.isatty(1) && env.TERM && env.TERM !== "dumb"

Yup, that's exactly what we're doing now. Should be fixed when you update your dependencies.

Ok well I think that would have actually solved my problem but it turns out postcss dropped colorette for nanocolors 12 hours ago 🤷