AriaMinaei/pretty-error

'color': 'none' still applies ansi codes

Closed this issue · 2 comments

reggi commented
"Error\u001b[0m:\u001b[0m \u001b[0mSome error message\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Object.<anonymous>\u001b[0m (/Users/thomas/Desktop/node-reggi/z-multi-line.js:89:9)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Module._compile\u001b[0m (module.js:430:26)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Object.Module._extensions..js\u001b[0m (module.js:448:10)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Module.load\u001b[0m (module.js:355:32)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Function.Module._load\u001b[0m (module.js:310:12)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m Function.Module.runMain\u001b[0m (module.js:471:10)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m startup\u001b[0m (node.js:117:18)\u001b[0m\n\u001b[0m    \u001b[0mat\u001b[0m \u001b[0mnode.js:953:3\u001b[0m\n\u001b[0m"

I can use chalk.stripColor(string) to remove them. Didn't expect ansi codes when color wasn't applied.

reggi commented

Just came across pe.withoutColors() however I get this error when I use it:

pe.withoutColors()
   ^
TypeError: pe.withoutColors is not a function

TypeError: pe.withoutColors is not a function

Try updating to the latest version.