{"record":{"id":"6b9f3d7d7cc31341","repo":"yamadashy/repomix","slug":"message-errortext-please-check-the-con","errorCode":null,"errorMessage":"${message}\n\n  ${errorText}\n\n  Please check the config file and try again.","messagePattern":"(.+?)\n\n  (.+?)\n\n  Please check the config file and try again\\.","errorType":"validation","errorClass":"RepomixConfigValidationError","httpStatus":null,"severity":"error","filePath":"src/shared/errorHandle.ts","lineNumber":173,"sourceCode":"    .map((issue) => {\n      const segments = Array.isArray(issue.path)\n        ? (issue.path as unknown[])\n            .map((segment) => {\n              // Zod: path segments are primitives. Valibot: { key } objects.\n              if (segment && typeof segment === 'object') {\n                if ('key' in segment) return String((segment as { key: unknown }).key);\n                return '';\n              }\n              return String(segment);\n            })\n            .filter((segment) => segment !== '')\n        : [];\n      // Omit the bracketed path entirely when there are no usable segments, so\n      // a root-level / path-less issue reads as `message` instead of `[] message`.\n      return segments.length === 0 ? issue.message : `[${segments.join('.')}] ${issue.message}`;\n    })\n    .join('\\n  ');\n  throw new RepomixConfigValidationError(\n    `${message}\\n\\n  ${errorText}\\n\\n  Please check the config file and try again.`,\n  );\n};\n","sourceCodeStart":155,"sourceCodeEnd":177,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/shared/errorHandle.ts#L155-L177","documentation":"rethrowValidationErrorIfSchemaError converts a Zod schema validation failure of the config file into a RepomixConfigValidationError whose message lists each issue (with its config path in brackets), the offending values, and a hint to check the config file. It exists so users get a readable, actionable message instead of a raw Zod error.","triggerScenarios":"Calling repomix (CLI or library) with a repomix.config.json / .json5 / .yaml whose fields violate the config schema: wrong types (e.g. `\"include\": \"string\"` instead of array), unknown enum values (bad `style`), out-of-range numbers (e.g. negative or too-large `topFilesLength`), or malformed JSON syntax.","commonSituations":"Hand-editing the config and quoting values incorrectly; migrating config from older repomix versions where option names/types changed; IDE autocomplete inserting wrong types; trailing commas or comments in plain .json.","solutions":["Read the bracketed paths and per-issue messages in the error; fix each listed field's type/value","Validate your JSON syntax (no trailing commas/comments in .json) with `node -e \"JSON.parse(require('fs').readFileSync('repomix.config.json'))\"`","Regenerate a known-good config with `repomix --init` and merge your settings in","Compare against the current config schema docs for your repomix version"],"exampleFix":"// before (repomix.config.json)\n{ \"include\": \"src/**/*.ts\", \"output\": { \"style\": \"markdown2\" } }\n// after\n{ \"include\": [\"src/**/*.ts\"], \"output\": { \"style\": \"markdown\" } }","handlingStrategy":"validation","validationCode":"import fs from 'node:fs';\ntry { JSON.parse(fs.readFileSync('repomix.config.json', 'utf8')); }\ncatch (e) { throw new Error(`Config is not valid JSON: ${e.message}`); }\n// then sanity-check known fields' types before running","typeGuard":"const isConfigArray = (v) => v === undefined || Array.isArray(v);\nconst isValidStyle = (v) => ['xml','markdown','json','plain'].includes(v);","tryCatchPattern":"import { RepomixConfigValidationError } from 'repomix';\ntry {\n  await runRepomix(configFile);\n} catch (e) {\n  if (e instanceof RepomixConfigValidationError) {\n    console.error(e.message); // lists each bad field; fix and retry\n  } else throw e;\n}","preventionTips":["Validate config against the schema in your editor","Never mix JSON5 syntax into plain .json files","After repomix upgrades, diff your config against the new schema","Regenerate with `repomix --init` and merge changes"],"tags":["config","schema-validation","zod"],"backgroundTag":"schema-validation-failed","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}