{"record":{"id":"68983a5401fbb40f","repo":"Foundry376/Mailspring","slug":"validation-failed-at-keypath-json-stringify-68983a","errorCode":null,"errorMessage":"Validation failed at ${keyPath}, ${JSON.stringify(value)} cannot be coerced into a number","messagePattern":"Validation failed at (.+?), (.+?) cannot be coerced into a number","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/src/config.ts","lineNumber":777,"sourceCode":"// specification.\nConfig.addSchemaEnforcers({\n  integer: {\n    coerce(keyPath, value, schema) {\n      value = parseInt(value, 10);\n      if (isNaN(value) || !isFinite(value)) {\n        throw new Error(\n          `Validation failed at ${keyPath}, ${JSON.stringify(value)} cannot be coerced into an int`\n        );\n      }\n      return value;\n    },\n  },\n\n  number: {\n    coerce(keyPath, value, schema) {\n      value = parseFloat(value);\n      if (isNaN(value) || !isFinite(value)) {\n        throw new Error(\n          `Validation failed at ${keyPath}, ${JSON.stringify(\n            value\n          )} cannot be coerced into a number`\n        );\n      }\n      return value;\n    },\n  },\n\n  boolean: {\n    coerce(keyPath, value, schema) {\n      switch (typeof value) {\n        case 'string':\n          if (value.toLowerCase() === 'true') {\n            return true;\n          } else if (value.toLowerCase() === 'false') {\n            return false;\n          } else {","sourceCodeStart":759,"sourceCodeEnd":795,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/src/config.ts#L759-L795","documentation":"Config schema enforcer for type 'number': parseFloat on the raw value produced NaN or Infinity, so the value cannot be coerced to a float. Typically a malformed string (empty, trailing text) written to the config file or passed to config.set.","triggerScenarios":"Thrown at app/src/config.ts:777 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the value at keyPath to a valid number (no stray characters)","Validate user numeric input before passing it to config.set"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"648c685d602ece6bb00c22534b8734de6ac644b3","analyzedAt":"2026-09-03T02:00:24.311Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}