{"record":{"id":"3ba439178ba9e4d2","repo":"paperclipai/paperclip","slug":"unknown-config-key-warning-path-did-you-mean-3ba439","errorCode":null,"errorMessage":"Unknown config key ${warning.path}; did you mean ${warning.suggestion}? It will be preserved.","messagePattern":"Unknown config key (.+?); did you mean (.+?)\\? It will be preserved\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/src/config-file.ts","lineNumber":35,"sourceCode":"}\n\nexport function readConfigFile(): PaperclipConfig | null {\n  const configPath = resolvePaperclipConfigPath();\n\n  if (!fs.existsSync(configPath)) return null;\n\n  let raw: unknown;\n  try {\n    raw = JSON.parse(fs.readFileSync(configPath, \"utf-8\"));\n  } catch (error) {\n    const reason = error instanceof Error ? error.message : String(error);\n    throw new Error(`Invalid Paperclip config at ${configPath}: failed to read or parse JSON: ${reason}`);\n  }\n\n  try {\n    const config = paperclipConfigSchema.parse(raw);\n    for (const warning of findPaperclipConfigKeyWarnings(config)) {\n      console.warn(\n        `Unknown config key ${warning.path}; did you mean ${warning.suggestion}? It will be preserved.`,\n      );\n    }\n    return config;\n  } catch (error) {\n    if (error instanceof ZodError) {\n      throw new Error(`Invalid Paperclip config at ${configPath}: ${formatConfigValidationError(error)}`);\n    }\n\n    throw error;\n  }\n}\n","sourceCodeStart":17,"sourceCodeEnd":48,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/config-file.ts#L17-L48","documentation":"After parsing the Paperclip config JSON, findPaperclipConfigKeyWarnings flags unrecognized keys that closely resemble known keys and prints a did-you-mean suggestion. The unknown key is preserved passthrough rather than dropped — but it has no effect until renamed, so the intended setting is silently inert.","triggerScenarios":"A config file contains a mistyped or renamed key that fuzzy-matches a valid one, e.g. a casing slip or a key renamed across Paperclip versions.","commonSituations":"Copy-pasting config from old docs or blog posts; upgrading Paperclip versions that renamed settings; hand-editing JSON and introducing typos; team members guessing key names.","solutions":["Rename the key to the warning's suggestion in the config file.","If the key is obsolete after an upgrade, delete it.","Cross-check against the current config schema/docs for the exact valid key name.","Add a config-lint step in CI that fails on any unknown-key warning."],"exampleFix":"// paperclip.config.json — before\n{ \"databseMode\": \"postgres\" }\n\n// after\n{ \"databaseMode\": \"postgres\" }","handlingStrategy":"validation","validationCode":"// Pre-deploy config gate: fail on any did-you-mean warning.\nconst config = loadPaperclipConfig(configPath);\nconst warnings = findPaperclipConfigKeyWarnings(config);\nif (warnings.length > 0) {\n  throw new Error(`Unknown config keys: ${warnings.map((w) => `${w.path} -> ${w.suggestion}`).join('; ')}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep config files in version control and review them like code.","Run schema validation with unknown-key detection in CI, failing builds on typos.","Read release notes for config key renames before upgrading.","Remember the unknown key is preserved but inert — the setting you think you set is not set."],"tags":["config","typo","schema","did-you-mean"],"backgroundTag":"unknown-config-key","analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}