Closed MickL closed 6 years ago
only support these props: { silly: 'rainbow', input: 'grey', verbose: 'cyan', prompt: 'grey', info: 'green', data: 'grey', help: 'cyan', warn: 'yellow', debug: 'blue', error: 'red' }
Same issue here, I have included the stack trace below in case it is needed.
<project folder>\node_modules\colors\lib\extendStringPrototype.js:89
ret = colors[theme[prop][t]](ret);
^
TypeError: colors[theme[prop][t]] is not a function
at String.info (<project folder>\node_modules\colors\lib\extendStringPrototype.js:89:43)
at Object.<anonymous> (<project folder>\index.js:14:21)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
Screenshot of the source code around the area it produced the error
Same issue here: TypeError: colors.verbose is not a function
If I use a built-in color name like green
in OP's example, everything works fine. So I believe this is not a bug with defining a custom theme; rather, it's just that colors.js doesn't support custom hex colors like that right now. That is one of the big features we have planned for an upcoming release though.
Please feel free to re-open if it seems like I'm missing something, thanks!
throws:
While default colors are working:
console.log('hello there'.yellow);