Skip to content

Using Uglify-JS debug prints wrong logs (with "color: #XXXXX" string) #547

@ibc

Description

@ibc

I use ES6 plus browserify plus Babel plus optional uglify-js.

Example to show the problem:

import debug from 'debug';

const logger = debug('device');

logger.info('browser supported [flag:%s, name:"%s", version:"%s"]', flag, name, version);

When I do NOT use uglify-js, everything is ok and the output is:

browser supported [flag:chrome, name:"Chrome", version:"64.0"]

However, when using `uglify-js, this happens:

browser supported [flag:color: #CC9933, name:"chrome", version:Chrome]

Which clearly shows that some wrong value is interpolated into the whole string and, somehow, "color: #CC9933" is printed as first %s argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis issue is out of scope or has been deemed invalidwont-fixThis is not a feature or proposal that will be incorporated, or a bug that won't be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions