{"record":{"id":"2ebcb77d5d01d570","repo":"tailwindlabs/tailwindcss","slug":"no-configuration-file-found-for-highlight-relati","errorCode":null,"errorMessage":"No configuration file found for ${highlight(relative(start))}. Please provide a path to the Tailwind CSS v3 config file via the ${highlight('--config')} option.","messagePattern":"No configuration file found for (.+?)\\. Please provide a path to the Tailwind CSS v3 config file via the (.+?) option\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@tailwindcss-upgrade/src/codemods/template/prepare-config.ts","lineNumber":108,"sourceCode":"  './tailwind.config.js',\n  './tailwind.config.cjs',\n  './tailwind.config.mjs',\n  './tailwind.config.ts',\n  './tailwind.config.cts',\n  './tailwind.config.mts',\n]\nexport async function detectConfigPath(start: string, end: string = start) {\n  for (let base of parentPaths(start, end)) {\n    for (let file of DEFAULT_CONFIG_FILES) {\n      let fullPath = path.resolve(base, file)\n      try {\n        await fs.access(fullPath)\n        return fullPath\n      } catch {}\n    }\n  }\n\n  throw new Error(\n    `No configuration file found for ${highlight(relative(start))}. Please provide a path to the Tailwind CSS v3 config file via the ${highlight('--config')} option.`,\n  )\n}\n\n// Yields all parent paths from `from` to `to` (inclusive on both ends)\nfunction* parentPaths(from: string, to: string = from) {\n  let fromAbsolute = path.resolve(from)\n  let toAbsolute = path.resolve(to)\n\n  if (!fromAbsolute.startsWith(toAbsolute)) {\n    throw new Error(`The path ${from} is not a parent of ${to}`)\n  }\n\n  if (fromAbsolute === toAbsolute) {\n    yield fromAbsolute\n    return\n  }\n","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/tailwindlabs/tailwindcss/blob/16e94cbf7f965c5ad697e90e940b5e178efad67c/packages/@tailwindcss-upgrade/src/codemods/template/prepare-config.ts#L90-L126","documentation":"`detectConfigPath` searches a list of default v3 config filenames (`tailwind.config.js`, `.cjs`, `.mjs`, `.ts`) walking up parent directories from `start` to `end`. If none is accessible via `fs.access`, the upgrade cannot locate the v3 config to migrate and throws, directing the user to pass `--config`.","triggerScenarios":"Running `@tailwindcss/upgrade` in a project with no `tailwind.config.*` file anywhere up the tree, or where the config has a non-default name. prepare-config.ts:108 throws after the `parentPaths`/`DEFAULT_CONFIG_FILES` loops complete without a hit.","commonSituations":"Projects that use a non-standard config filename (`tw.config.js`), config-in-JS without a file, or running the upgrade from the wrong directory.","solutions":["Pass the explicit path: `npx @tailwindcss/upgrade --config ./path/to/tailwind.config.js`.","Rename/create a config file using a default name in the project root.","Run the upgrade from the directory containing the v3 config."],"exampleFix":"# before\nnpx @tailwindcss/upgrade\n\n# after\nnpx @tailwindcss/upgrade --config ./tw.config.js","handlingStrategy":"validation","validationCode":"import { accessSync } from 'node:fs'\nimport path from 'node:path'\nconst DEFAULTS = ['tailwind.config.js','tailwind.config.cjs','tailwind.config.mjs','tailwind.config.ts']\nfunction findV3Config(start: string, end = start) {\n  for (const base of parentDirs(start, end)) {\n    for (const f of DEFAULTS) {\n      try { accessSync(path.resolve(base, f)); return path.resolve(base, f) } catch {}\n    }\n  }\n  throw new Error('No v3 config found; pass --config <path>')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a default tailwind.config.* filename.","Pass --config explicitly when using a non-default name.","Run the upgrade from the directory containing the v3 config."],"tags":["upgrade","config-detection","setup"],"backgroundTag":null,"analyzedSha":"16e94cbf7f965c5ad697e90e940b5e178efad67c","analyzedAt":"2026-08-12T06:02:42.469Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}