{"record":{"id":"eee7493889a5f246","repo":"ramensoftware/windhawk","slug":"unknown-setting-type-for-value-json-stringify-value","errorCode":null,"errorMessage":"Unknown setting type for value: ${JSON.stringify(value)}","messagePattern":"Unknown setting type for value: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/windhawk-frontend/apps/windhawk-frontend/src/app/panel/mod-details/tabs/settings/core/yamlConverter.ts","lineNumber":206,"sourceCode":"    if (first.length === 0) {\n      throw new Error('Invalid object array schema definition.');\n    }\n    return { kind: SettingType.ObjectArray, value: arrayValue, children: first };\n  }\n\n  if (isInitialSettingsArray(arrayValue)) {\n    return { kind: SettingType.NestedObject, value: arrayValue, children: arrayValue };\n  }\n\n  if (isNumberArrayValue(arrayValue)) {\n    return { kind: SettingType.NumberArray, value: arrayValue, defaultValue: 0 };\n  }\n\n  if (isStringArrayValue(arrayValue)) {\n    return { kind: SettingType.StringArray, value: arrayValue, defaultValue: '' };\n  }\n\n  throw new Error(`Unknown setting type for value: ${JSON.stringify(value)}`);\n}\n\n// ============================================================================\n// Utility Functions\n// ============================================================================\n\nexport function parseIntLax(value?: string | number | null) {\n  const result = parseInt((value ?? 0).toString(), 10);\n  return Number.isNaN(result) ? 0 : result;\n}\n\n/**\n * Helper to check if a value is a plain object (not array, not null)\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n  return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/ramensoftware/windhawk/blob/61d99ed8e182e1af1b60109612b6763ad1b4b74e/src/windhawk-frontend/apps/windhawk-frontend/src/app/panel/mod-details/tabs/settings/core/yamlConverter.ts#L188-L224","documentation":"describeSetting() is a fall-through normalizer: after string, object-array, nested-object, and string-array branches all fail, it has no known SettingType for the value and throws with a JSON dump of it. It is the converter's exhaustiveness guard for unrecognized shapes.","triggerScenarios":"Passing a value like a bare number, boolean, plain object, or mixed array (not all strings) that matches none of isInitialSettingsCollection/isInitialSettingsArray/isStringArrayValue to describeSetting.","commonSituations":"Mod YAML uses a numeric or boolean initial value where only string/array forms are supported; mixed-type arrays from hand-edited settings blocks.","solutions":["Convert the value to a supported form: quote numbers/booleans as strings in the YAML","Use a homogeneous string array for string-array settings","Extend describeSetting with a branch if a new legitimate type must be supported"],"exampleFix":"// before\nmySetting = 42\n// after\nmySetting = '42'","handlingStrategy":"type-guard","validationCode":"const isSupportedSettingValue = (v: unknown): boolean =>\n  typeof v === 'string' ||\n  (Array.isArray(v) && (v.every(x => typeof x === 'string') || Array.isArray(v[0])));","typeGuard":"const isStringArray = (v: unknown): v is string[] =>\n  Array.isArray(v) && v.every(x => typeof x === 'string');","tryCatchPattern":"try { desc = describeSetting(value); } catch (e) { if (e.message.startsWith('Unknown setting type')) console.warn('skipping unsupported setting', value); else throw e; }","preventionTips":["Quote numeric/boolean values as strings in mod settings YAML","Keep arrays homogeneous (all strings) unless defining object tables","Pre-validate value shapes before calling describeSetting"],"tags":["yaml","type-mismatch","validation"],"backgroundTag":"unsupported-value-type","analyzedSha":"61d99ed8e182e1af1b60109612b6763ad1b4b74e","analyzedAt":"2026-09-12T14:02:41.115Z","contentChangedAt":"2026-09-12T14:02:41.115Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}