{"record":{"id":"4879c41d54ab1852","repo":"diegosouzapw/OmniRoute","slug":"hot-reload-failed-to-parse-persisted-settings-fi","errorCode":null,"errorMessage":"[HOT_RELOAD] Failed to parse persisted settings field \"${field}\":","messagePattern":"\\[HOT_RELOAD\\] Failed to parse persisted settings field \"(.+?)\":","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/config/runtimeSettings.ts","lineNumber":127,"sourceCode":"\n  if (value && typeof value === \"object\") {\n    return Object.fromEntries(\n      Object.keys(value as JsonRecord)\n        .sort((left, right) => left.localeCompare(right))\n        .map((key) => [key, canonicalize((value as JsonRecord)[key])])\n    );\n  }\n\n  return value;\n}\n\nfunction parseStoredJson(value: unknown, field: string): unknown {\n  if (typeof value !== \"string\") return value;\n\n  try {\n    return JSON.parse(value);\n  } catch (error) {\n    console.warn(\n      `[HOT_RELOAD] Failed to parse persisted settings field \"${field}\":`,\n      error instanceof Error ? error.message : error\n    );\n    return null;\n  }\n}\n\nfunction normalizeStringArray(value: unknown): string[] {\n  if (!Array.isArray(value)) return [];\n\n  return Array.from(\n    new Set(\n      value\n        .map((entry) => (typeof entry === \"string\" ? entry.trim() : \"\"))\n        .filter((entry) => entry.length > 0)\n    )\n  );\n}","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/config/runtimeSettings.ts#L109-L145","documentation":"A persisted settings field stored as a JSON string failed JSON.parse — the raw DB value is corrupted or was written in a non-JSON format. The parse helper falls back to returning the raw string value so the caller's own normalization/defaults take over; the field is effectively treated as unset or invalid.","triggerScenarios":"Thrown at src/lib/config/runtimeSettings.ts:127 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Identify the affected settings field from the log","Reset the field to a valid value via the settings API/dashboard","Check for older writes that serialized the field incorrectly"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}