{"record":{"id":"158b9aa63a2ee51e","repo":"denoland/deno","slug":"err-invalid-arg-value-158b9a","errorCode":"ERR_INVALID_ARG_VALUE","errorMessage":"The property 'input.escapeCodeTimeout' is invalid. Received ${this.escapeCodeTimeout}","messagePattern":"The property 'input\\.escapeCodeTimeout' is invalid\\. Received (.+?)","errorType":"validation","errorClass":"ERR_INVALID_ARG_VALUE","httpStatus":null,"severity":"error","filePath":"ext/node/polyfills/internal/readline/interface.mjs","lineNumber":209,"sourceCode":"    output = input.output;\n    completer = input.completer;\n    terminal = input.terminal;\n    history = input.history;\n    historySize = input.historySize;\n    signal = input.signal;\n    if (input.tabSize !== undefined) {\n      validateUint32(input.tabSize, \"tabSize\", true);\n      this.tabSize = input.tabSize;\n    }\n    removeHistoryDuplicates = input.removeHistoryDuplicates;\n    if (input.prompt !== undefined) {\n      prompt = input.prompt;\n    }\n    if (input.escapeCodeTimeout !== undefined) {\n      if (NumberIsFinite(input.escapeCodeTimeout)) {\n        this.escapeCodeTimeout = input.escapeCodeTimeout;\n      } else {\n        throw new ERR_INVALID_ARG_VALUE(\n          \"input.escapeCodeTimeout\",\n          this.escapeCodeTimeout,\n        );\n      }\n    }\n\n    if (signal) {\n      validateAbortSignal(signal, \"options.signal\");\n    }\n\n    crlfDelay = input.crlfDelay;\n    input = input.input;\n  }\n\n  if (completer !== undefined && typeof completer !== \"function\") {\n    throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n  }\n","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/ext/node/polyfills/internal/readline/interface.mjs#L191-L227","documentation":"readline.createInterface requires options.escapeCodeTimeout to be a finite number when provided (it is the ms delay waiting for an escape-sequence, default 500). Number.isFinite(input.escapeCodeTimeout) failing — NaN, Infinity, or any non-number including strings — throws ERR_INVALID_ARG_VALUE('input.escapeCodeTimeout'). Note the Deno polyfill reports this.escapeCodeTimeout (still the default 500 at that point) in the message, so 'Received 500' does not reflect the value you actually passed.","triggerScenarios":"createInterface({ input, escapeCodeTimeout: Infinity }); passing '500' as a string from config; computing the value as a division that yields NaN or Infinity.","commonSituations":"Tuning escape-code timing for slow SSH/telnet terminals; values read from env vars or JSON config that arrive as strings; reusing a timeout constant that was set to Infinity elsewhere.","solutions":["Pass a plain finite number: escapeCodeTimeout: 1000","Coerce from config: Number(cfg.escapeCodeTimeout) and check Number.isFinite before passing","Omit the option entirely to keep the 500 ms default"],"exampleFix":"// before\ncreateInterface({ input, escapeCodeTimeout: Number.POSITIVE_INFINITY });\n\n// after\ncreateInterface({ input, escapeCodeTimeout: 1000 });","handlingStrategy":"validation","validationCode":"function makeRl(input: NodeJS.ReadableStream, opts: Record<string, unknown>) {\n  const t = opts.escapeCodeTimeout;\n  return readline.createInterface({\n    input,\n    ...(Number.isFinite(t) ? { escapeCodeTimeout: t as number } : {}),\n  });\n}","typeGuard":"const isFiniteNumber = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v);","tryCatchPattern":"try {\n  rl = readline.createInterface({ input, escapeCodeTimeout: t } as readline.ReadLineOptions);\n} catch (err) {\n  if (err?.code === 'ERR_INVALID_ARG_VALUE' && /escapeCodeTimeout/.test(err.message)) {\n    rl = readline.createInterface({ input }); // default 500ms\n  } else throw err;\n}","preventionTips":["Coerce config/env timeouts with Number() and verify Number.isFinite before passing","Omit escapeCodeTimeout unless you specifically tune escape-sequence timing"],"tags":["readline","node-compat","deno","options-validation","timeout"],"backgroundTag":"invalid-argument-value","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}