{"record":{"id":"c412d05c5dab5ded","repo":"vercel/turborepo","slug":"found-catalog-reference-but-catalogfilename-doe","errorCode":null,"errorMessage":"Found catalog reference but ${catalogFileName} does not exist","messagePattern":"Found catalog reference but (.+?) does not exist","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/turbo-codemod/src/commands/migrate/steps/update-catalog.ts","lineNumber":64,"sourceCode":"  } else if (packageJson.dependencies && \"turbo\" in packageJson.dependencies) {\n    turboSpecifier = packageJson.dependencies.turbo;\n    installType = \"dependencies\";\n  } else {\n    return undefined;\n  }\n\n  if (!turboSpecifier?.startsWith(\"catalog:\")) {\n    return undefined;\n  }\n\n  const catalogFileName = CATALOG_FILES[packageManager];\n  if (!catalogFileName) {\n    return undefined;\n  }\n\n  const catalogFile = path.join(root, catalogFileName);\n  if (!fs.existsSync(catalogFile)) {\n    logger.warn(\n      `Found catalog reference but ${catalogFileName} does not exist`\n    );\n    return undefined;\n  }\n\n  const ref = turboSpecifier.slice(\"catalog:\".length);\n  const catalogName = ref === \"\" || ref === \"default\" ? null : ref;\n\n  return { catalogName, catalogFile, installType };\n}\n\n/**\n * Update the turbo version in a catalog file (pnpm-workspace.yaml or .yarnrc.yml).\n * Preserves the existing version range prefix (^, ~, etc.) and YAML formatting.\n *\n * Returns true if the catalog was updated.\n */\nexport function updateCatalogVersion({","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/vercel/turborepo/blob/f9245100cf0d31d96628804ead485f6bf226e55a/packages/turbo-codemod/src/commands/migrate/steps/update-catalog.ts#L46-L82","documentation":"Emitted by the update-catalog step of turbo-codemod's `migrate` command. It resolves a `catalog:` specifier for turbo in the root package.json and needs the package manager's catalog file (CATALOG_FILES maps pnpm to pnpm-workspace.yaml and yarn to .yarnrc.yml) at the repo root; when that file is missing the step warns and returns undefined, so the catalog-based turbo update is skipped for this run.","triggerScenarios":"Running `npx @turbo/codemod migrate` where the root package.json has `\"turbo\": \"catalog:\"` or `catalog:<name>` for pnpm or yarn, but the corresponding catalog file (pnpm-workspace.yaml / .yarnrc.yml) does not exist at the resolved root.","commonSituations":"pnpm-workspace.yaml renamed, moved, or never committed; codemod invoked from a subdirectory so root resolution picks the wrong folder; catalog references left behind after migrating off pnpm.","solutions":["Ensure pnpm-workspace.yaml (or .yarnrc.yml) exists at the repo root and contains the catalog entry","Run the codemod from the repository root","If catalogs are no longer used, replace the `catalog:` specifier with an explicit version before migrating"],"exampleFix":"# before: package.json references a catalog with no backing file\n\"devDependencies\": { \"turbo\": \"catalog:\" }\n# pnpm-workspace.yaml missing\n\n# after: pnpm-workspace.yaml\npackages:\n  - 'apps/*'\n  - 'packages/*'\ncatalog:\n  turbo: '^2.3.3'","handlingStrategy":"validation","validationCode":"import fs from 'node:fs';\nimport path from 'node:path';\n\n// before running the codemod\nconst catalog = path.join(repoRoot, 'pnpm-workspace.yaml');\nif (specifier.startsWith('catalog:') && !fs.existsSync(catalog)) {\n  throw new Error(`catalog reference requires ${catalog} to exist`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run @turbo/codemod migrate from the repository root so root/catalog resolution is correct","Keep pnpm-workspace.yaml (and .yarnrc.yml for yarn) at the root and in version control","Replace stale `catalog:` specifiers when migrating off pnpm catalogs"],"tags":["codemod","pnpm","catalog","migration"],"backgroundTag":"missing-config-file","analyzedSha":"f9245100cf0d31d96628804ead485f6bf226e55a","analyzedAt":"2026-08-17T10:46:15.696Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}