{"record":{"id":"cf1420aa5f21a5be","repo":"shadcn-ui/ui","slug":"unsupported-path-type-options-path-cf1420","errorCode":null,"errorMessage":"Unsupported path type: ${options.path}","messagePattern":"Unsupported path type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/migrations/migrate-rtl.ts","lineNumber":58,"sourceCode":"    } else {\n      const fullPath = path.resolve(basePath, options.path)\n      const stat = await fs.stat(fullPath).catch(() => null)\n\n      if (!stat) {\n        throw new Error(`File not found: ${options.path}`)\n      }\n\n      if (stat.isDirectory()) {\n        basePath = fullPath\n        files = await fg(\"**/*.{js,ts,jsx,tsx}\", {\n          cwd: basePath,\n          onlyFiles: true,\n          ignore: [\"**/node_modules/**\"],\n        })\n      } else if (stat.isFile()) {\n        files = [options.path]\n      } else {\n        throw new Error(`Unsupported path type: ${options.path}`)\n      }\n    }\n\n    if (files.length === 0) {\n      throw new Error(`No files found matching: ${options.path}`)\n    }\n  } else {\n    // Default: use ui path from components.json.\n    if (!config.resolvedPaths.ui) {\n      throw new Error(\n        \"Could not find a valid `ui` path in your `components.json`. Please provide a path or glob pattern.\"\n      )\n    }\n\n    basePath = config.resolvedPaths.ui\n    files = await fg(\"**/*.{js,ts,jsx,tsx}\", {\n      cwd: basePath,\n      onlyFiles: true,","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/migrations/migrate-rtl.ts#L40-L76","documentation":"Thrown by migrateRtl when fs.stat succeeds but the entry is neither a regular file nor a directory — sockets, FIFOs, devices, or broken symlinks. The RTL migrator only handles files (transform in place) and directories (recursive glob), so other inode types are rejected up front.","triggerScenarios":"Pointing --path at a special file (e.g. /dev/null, a socket); a dangling symlink; a shell glob that expanded to a non-file path.","commonSituations":"Accidental special-file path; broken symlink left from a failed package install.","solutions":["Point --path at a real source file or directory.","Inspect symlinks with `readlink <path>` and fix or remove broken ones.","Use a glob pattern so fast-glob filters to real files."],"exampleFix":"// before\nshadcn migrate rtl --path /tmp/app.sock\n\n// after\nshadcn migrate rtl --path ./src/components/ui","handlingStrategy":"type-guard","validationCode":"import fs from 'fs/promises'\nimport path from 'path'\n\nasync function assertPlainFileOrDir(rel: string, cwd: string) {\n  const stat = await fs.stat(path.resolve(cwd, rel)).catch(() => null)\n  if (stat && !stat.isFile() && !stat.isDirectory()) {\n    throw new Error(`Unsupported path type: ${rel}`)\n  }\n}","typeGuard":"import { Stats } from 'fs'\n\nfunction isMigratableStat(stat: Stats | null): boolean {\n  return Boolean(stat && (stat.isFile() || stat.isDirectory()))\n}","tryCatchPattern":null,"preventionTips":["Prefer globs over explicit special-file paths.","Inspect special inodes with `stat` before invoking.","Clean up broken symlinks left by failed installs."],"tags":["migration","rtl","filesystem","path-resolution","edge-case"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}