{"record":{"id":"d400ce1a4e62d1c8","repo":"quasarframework/quasar","slug":"err-parse-args-unknown-option","errorCode":"ERR_PARSE_ARGS_UNKNOWN_OPTION","errorMessage":"Unknown error while parsing arguments","messagePattern":"Unknown error while parsing arguments","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app-vite/lib/utils/get-argv.js","lineNumber":20,"sourceCode":"import { warn } from './logger.js'\n\nexport function getArgv(options, { strict = true } = {}) {\n  try {\n    const { values, positionals } = parseArgs({\n      options,\n      strict,\n      allowPositionals: true\n    })\n\n    return { ...values, _: positionals }\n  } catch (err) {\n    return {\n      help: true,\n      _: [],\n\n      // Should be handled if (argv.help) in the caller\n      __warn() {\n        warn(\n          err?.code === 'ERR_PARSE_ARGS_UNKNOWN_OPTION'\n            ? err.message\n            : 'Unknown error while parsing arguments'\n        )\n        warn()\n        process.exit(1)\n      }\n    }\n  }\n}\n","sourceCodeStart":2,"sourceCodeEnd":31,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/utils/get-argv.js#L2-L31","documentation":"app-vite's get-argv wraps Node's util.parseArgs. When parsing CLI flags throws, the wrapper returns a sentinel argv whose __warn() function prints either the parseArgs message (for ERR_PARSE_ARGS_UNKNOWN_OPTION, i.e. an unrecognized option) or this generic fallback, then exits 1. It exists so callers can uniformly handle bad CLI input via `if (argv.help)`-style checks.","triggerScenarios":"Invoking any `quasar`/app-vite dev-mode command with an option that is not registered in that command's parseArgs configuration — e.g. a typo like `--pot 9000` instead of `--port 9000`, or an unknown shorthand — triggers ERR_PARSE_ARGS_UNKNOWN_OPTION which is reported through this handler; the generic message appears for any other parse failure.","commonSituations":"Typos in long flags; using an option from a different command (e.g. passing an icongenie-only flag to `quasar dev`); copy-pasted flags from blog posts for older Quasar versions; unquoted values that split into extra tokens.","solutions":["Run the command with `--help` to see the exact supported options for that subcommand","Fix or remove the unrecognized flag; check spelling (`--port` not `--pot`)","Check the Quasar docs for the current option names — flags change between major versions","Quote values containing spaces or special characters so they don't parse as extra options"],"exampleFix":"// before\nquasar dev --pot 9000\n// after\nquasar dev --port 9000","handlingStrategy":"validation","validationCode":"// pre-check flags against the command's help output before scripting it\nconst { execSync } = require('node:child_process')\nconst help = execSync('quasar dev --help').toString()\nconst flag = '--port'\nif (!help.includes(flag)) {\n  throw new Error(`Flag ${flag} is not supported by 'quasar dev'`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always check `quasar <cmd> --help` before using a flag you haven't used recently","Don't mix flags between subcommands or between Quasar packages (app-vite vs cli vs icongenie)","Quote argument values containing spaces or special characters","Pin and read the docs for your installed Quasar version; option names change between majors"],"tags":["cli","arguments","parseargs","app-vite"],"backgroundTag":"unknown-cli-option","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}