question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Print the "invalid value" for `output` in CLI flags

See original GitHub issue

FAQ

URL

https://www.google.com

What happened?

$ npx lighthouse --output=json --output=html https://www.google.com throws Invalid values. Argument ‘output’ must be an array from choices “json”, “html”, “csv”

node: v12.22.3 “lighthouse”: “8.1.0”

What did you expect?

It to run.

What have you tried?

No response

How were you running Lighthouse?

CLI

Lighthouse Version

8.1.0

Chrome Version

No response

Node Version

12.22.3

Relevant log output

Invalid values. Argument 'output' must be an array from choices "json", "html", "csv"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
patrickhulcecommented, Jul 28, 2021

Go for it @svkrclg!

Basically in https://github.com/GoogleChrome/lighthouse/blob/233c56ec5cc95fdbd0db32885741732da2e74e3e/lighthouse-cli/cli-flags.js#L364-L374

you’ll want to add the value that failed validation to our error message instead of just a generic one 😃

0reactions
patrickhulcecommented, Sep 9, 2021

This has been solved by #12836, thanks @rohan-kulkarni-25!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Control fmt.Parse output on Parsing Error - Stack Overflow
You can set the output (an io.Writer ) where error messages are printed with the FlagSet.SetOutput() method. You can set a bytes.
Read more >
`conda run` verbosity and output control flags are confusing ...
Every command that exits non-zero displays this very annoying error message (although it's probably only so annoying because I've been using conda-run so...
Read more >
CS 11: How to write usage statements
If a program is called with incorrect command-line arguments, it should detect that fact and print a usage statement to the terminal.
Read more >
Printing and Colors - Typer - tiangolo
It will show the output normally: fast →python main.py. Hello World ... You can print to "standard error" creating a Rich Console with...
Read more >
argparse — Parser for command-line options, arguments and ...
The program defines what arguments it requires, and argparse will figure out how to parse those out of sys.argv . The argparse module...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found