{"record":{"id":"3a118ee28956c1e0","repo":"shadcn-ui/ui","slug":"no-files-found-matching-options-path-3a118e","errorCode":null,"errorMessage":"No files found matching: ${options.path}","messagePattern":"No files found matching: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/migrations/migrate-radix.ts","lineNumber":143,"sourceCode":"        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,\n    })\n  }\n\n  // Confirm with user.\n  if (!options.yes) {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/migrations/migrate-radix.ts#L125-L161","documentation":"Thrown by migrateRadix after fast-glob returns an empty result for a user-supplied --path. Identical in semantics to migrate-icons' 'No files found' guard: the path/glob was valid but matched zero migratable files. The migrator refuses to proceed with an empty file set.","triggerScenarios":"A glob that matches nothing; a directory containing no .js/.ts/.jsx/.tsx files; a directory whose only matches are ignored by the '**/node_modules/**' rule; running from a cwd where the relative path does not resolve as expected.","commonSituations":"Typo in glob; pointing at a non-JS source tree; running from the wrong directory; pointing at an empty directory.","solutions":["Confirm the glob matches files: `ls <glob>` or use `fd -e tsx -e ts <dir>`.","Ensure the path is relative to config.resolvedPaths.cwd.","If the target directory has only non-JS files, point --path at specific files instead."],"exampleFix":"// before\nshadcn migrate radix --path './src/legacy/**/*.bak'\n\n// after\nshadcn migrate radix --path './src/components/**/*.tsx'","handlingStrategy":"validation","validationCode":"import fg from 'fast-glob'\nimport path from 'path'\n\nasync function assertGlobHasMatches(input: string, cwd: string) {\n  const files = await fg(input.includes('*') ? input : '**/*.{js,ts,jsx,tsx}', {\n    cwd: input.includes('*') ? cwd : path.resolve(cwd, input),\n    onlyFiles: true,\n    ignore: ['**/node_modules/**']\n  })\n  if (files.length === 0) throw new Error(`No files found matching: ${input}`)\n}\n\nawait assertGlobHasMatches(options.path, config.resolvedPaths.cwd)","typeGuard":null,"tryCatchPattern":"try {\n  await migrateRadix(config, { path: input, yes: true })\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('No files found matching:')) {\n    logger.warn(`Nothing to migrate for ${input}`)\n  } else throw e\n}","preventionTips":["Test globs with `fd` / `ls` before wiring them into migration scripts.","Remember directory traversal is limited to .js/.ts/.jsx/.tsx.","Keep node_modules out of the target tree to avoid the ignore rule eating all matches."],"tags":["migration","radix","glob","path-resolution","user-input"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}