Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request logging CLI option reported as unknown #744

Closed
ssams opened this issue Nov 9, 2022 · 5 comments
Closed

Request logging CLI option reported as unknown #744

ssams opened this issue Nov 9, 2022 · 5 comments

Comments

@ssams
Copy link

ssams commented Nov 9, 2022

Description

the CLI utility lists a "--no-request-logging" option (shorthand "-L") in its "--help" output, which does not work. The CLI fails to start and reports the parameter as unknown if it's present on the command line:

npx serve@14.1.1 --no-request-logging dist/

error:

/root/.npm/_npx/abcb09c5f4b4e0d1/node_modules/arg/index.js:132
                                                throw new ArgError(
                                                      ^

ArgError: unknown or unexpected option: --no-request-logging
    at arg (/root/.npm/_npx/abcb09c5f4b4e0d1/node_modules/arg/index.js:132:13)
    at parseArguments (file:///root/.npm/_npx/abcb09c5f4b4e0d1/node_modules/serve/build/main.js:390:28)
    at file:///root/.npm/_npx/abcb09c5f4b4e0d1/node_modules/serve/build/main.js:467:40
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:526:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12) {
  code: 'ARG_UNKNOWN_OPTION'
}

looks like the option is only present in the static help text in

-L, --no-request-logging Do not log any request information to the console.
, but missing in the actual parsed options in
const options = {
?

Library version

14.1.1

Node version

v16.18.1

@gamemaker1
Copy link
Contributor

Oops yes it is missing, let me fix that :)

@ghost
Copy link

ghost commented Nov 9, 2022

When this will be fixed? @gamemaker1

@gamemaker1
Copy link
Contributor

A PR is already open to address this - #742

@livinglogic-nl
Copy link

Can somebody please merge #742 ?

We use serve in our pipelines and our build logs are now flooded with log messages.
#742 semi-fixes this by at least allowing us to turn off the verbose logging.

It seems weird that people are apparently forking this project to fix the issue when this PR could just be approved...

@AndyBitz
Copy link
Contributor

Thank you for opening the issue, the PR with the fix #742 has been merged and is part of the latest release 14.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants