Skip to content

Error messages shown as solid red bars #465

Description

Error messages are not readable, likely because they are printed as red text over a red background:

npx tfx-cli extension create --manifests does-not-exist.json

image

Disabling coloring with --no-color makes the error message appear:

npx tfx-cli extension create --manifests does-not-exist.json --no-color

image

Activity

  1. polatengin commented on Sep 26, 2024

    @polatengin
    Collaborator

    Hi Matthieu Maitre (@mmaitre314) ,

    Can I kindly ask you to check your terminal settings? Do you have any theme, or formatting settings applied?

    I try it on a few terminals, I couldn't repro the issue.

    The error, and the message is thrown by the node itself when we try to read the file.

    Node should be able to render the error message in correct formatting.

  2. mmaitre314 commented on Sep 26, 2024

    @mmaitre314
    Author

    I am using the Windows command prompt which should be in plain-vanilla configuration. Looking at the code, in /app/lib/trace.ts it looks like console.error sets the foreground as red and colors.bgRed makes the background red, so this ends up being printed as red-over-red.

    export function error(msg: any, ...replacements: printable[]): void {
    	log("error: ", msg, colors.bgRed, replacements, console.error);
    }

    Quick test in the Node REPL:

    image

  3. polatengin commented on Sep 26, 2024

    @polatengin
    Collaborator

    yes, I could repro the issue on my end, too 👍

  4. linked a pull request that will close this issuefixing error log format #475on Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions