{"record":{"id":"41ff2c1bb0946e8c","repo":"shadcn-ui/ui","slug":"unsupported-path-type-options-path-41ff2c","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-radix.ts","lineNumber":138,"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        \"We could not find a valid `ui` path in your `components.json` file. Please ensure you have a valid `ui` path in your `components.json` file.\"\n      )\n    }\n\n    basePath = config.resolvedPaths.ui\n    files = await fg(\"**/*.{js,ts,jsx,tsx}\", {\n      cwd: basePath,\n      onlyFiles: true,","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/migrations/migrate-radix.ts#L120-L156","documentation":"Thrown by migrateRadix when fs.stat succeeds but the entry is neither a regular file nor a directory — i.e. a socket, FIFO, character/block device, or broken symlink. The migrator only knows how to handle files (migrate in place) and directories (recursively glob for code files), so any other inode type is rejected.","triggerScenarios":"Pointing --path at /dev/null, a unix socket, a named pipe, or a dangling symlink; on some systems, pointing at a symlink whose target has been removed returns a stat for the link itself which is neither isFile nor isDirectory in edge cases.","commonSituations":"Accidental glob expansion in the shell produced a special file path; path is a broken symlink left by a failed install.","solutions":["Point --path at a real file or directory containing source code.","If a symlink, fix or remove it (`readlink <path>` to inspect).","Use a glob pattern instead, which fast-glob will resolve to actual files only."],"exampleFix":"// before\nshadcn migrate radix --path /tmp/my-fifo\n\n// after — target a source file or directory\nshadcn migrate radix --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  return stat\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":["Avoid pointing the migrator at /dev/null, sockets, or FIFOs.","Use globs instead of explicit special-file paths so fast-glob filters to regular files.","Inspect suspicious paths with `stat <path>` before invoking."],"tags":["migration","radix","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"}