mikaelbr/gulp-notify

Notification message includes unicode

Opened this issue · 2 comments

Greetings, I'm outputting the error like this:

.on('error', notify.onError(function( err ){ return { message: err.message, title : 'CSS Error'}; } ) )

And my Mac notification is showing the formatting code.

'\u001b[31m error\u001b[0m src/scss/style.scss (Line 17: Invalid CSS after "sadsad": expected "{", was "")\n\u001b[31mCompilation failed in 1 files.\n\u001b[0m'

Any way to get rid of the unicode data?

I think this is the result of color output, probably from chalk, try clearing the color from message by doing chalk.stripColor(err.message) and see if that works better.

I think there might be a need to have this as a part of gulp-notify core.

Tried that by doing

'.on('error', notify.onError(function( err ){ return { message: chalk.stripColor(err.message), title : 'CSS Error'}; } ) )'

No luck, but thanks for the direction to look into. I agree this needs to be part of core.