{"record":{"id":"d67d2bd37bbcdfa4","repo":"windmill-labs/windmill","slug":"skipping-latest-version-check-e-instanceof-erro","errorCode":null,"errorMessage":"Skipping latest-version check: ${e instanceof Error ? e.message : String(e)}","messagePattern":"Skipping latest-version check: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"cli/src/main.ts","lineNumber":178,"sourceCode":"    \"Specify headers to use for all requests. e.g: \\\"HEADERS='h1: v1, h2: v2'\\\"\"\n  )\n  .version(VERSION)\n  .versionOption(false)\n  // Override the default help option action so that a failure to contact\n  // the npm registry (e.g. offline / firewalled environment) does not\n  // prevent help from being displayed. Cliffy's default action awaits\n  // `checkVersion` before `showHelp`, which aborts the whole command if\n  // the fetch to registry.npmjs.org fails.\n  .helpOption(\"-h, --help\", \"Show this help.\", {\n    action: async function () {\n      const self = this as any;\n      const long = self\n        .getRawArgs()\n        .includes(`--${self.getHelpOption()?.name}`);\n      try {\n        await checkVersionSafe(self);\n      } catch (e) {\n        log.warn(\n          `Skipping latest-version check: ${\n            e instanceof Error ? e.message : String(e)\n          }`\n        );\n      }\n      self.showHelp({ long });\n      self.exit();\n    },\n  })\n  .command(\"init\", init)\n  .command(\"refresh\", refresh)\n  .command(\"app\", app)\n  .command(\"flow\", flow)\n  .command(\"script\", script)\n  .command(\"workspace\", workspace)\n  .command(\"resource\", resource)\n  .command(\"resource-type\", resourceType)\n  .command(\"user\", user)","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/main.ts#L160-L196","documentation":"During `wmill help` handling, main.ts calls checkVersionSafe, which fetches the latest wmill version from npmjs to warn about outdated CLIs. If that network check throws, the CLI logs this warning (including the underlying error message) and continues to show help. No functionality is lost beyond the outdated-version hint.","triggerScenarios":"Running `wmill --help` (or any help invocation) while checkVersionSafe throws — no network access, npmjs unreachable, DNS failure, proxy blocking registry.npmjs.org, or TLS issues.","commonSituations":"Air-gapped or firewalled corporate environments; CI runners without egress to npmjs; broken corporate TLS-intercepting proxies; DNS misconfiguration.","solutions":["Ensure network egress to registry.npmjs.org from the machine running wmill.","Configure HTTPS_PROXY/HTTP_PROXY so the CLI can reach npmjs through the corporate proxy.","Disable or bypass the version check if your environment intentionally has no internet (e.g. WINDMILL_NO_VERSION_CHECK / equivalent env flag if supported).","Ignore the warning — help still displays and the CLI is fully usable."],"exampleFix":"// before (no egress in CI)\nwmill --help\n// Skipping latest-version check: Unable to connect\n\n// after: route through the corporate proxy\nexport HTTPS_PROXY=http://proxy.corp.internal:3128\nwmill --help","handlingStrategy":"fallback","validationCode":"// probe npm reachability before commands whose logs must stay clean\ntry {\n  await fetch(\"https://registry.npmjs.org/wmill/latest\", { signal: AbortSignal.timeout(3000) });\n} catch {\n  console.log(\"npmjs unreachable; version check will be skipped\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  await $`wmill --help`;\n} catch (e) {\n  // help still prints after the warning; only surface real usage errors\n  if (!String(e).includes(\"latest-version\")) throw e;\n}","preventionTips":["Configure HTTPS_PROXY in restricted environments","Accept the warning in air-gapped setups — help output is unaffected","Use the CLI's no-version-check option in offline CI to silence it","Monitor registry.npmjs.org reachability if the notice matters to you"],"tags":["cli","network","version-check","offline"],"backgroundTag":"network-request-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}