{"record":{"id":"5da55457803dbb0d","repo":"shadcn-ui/ui","slug":"no-files-found-matching-options-path","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-icons.ts","lineNumber":103,"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    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    })\n  }\n\n  const registryIcons = await getRegistryIcons()\n\n  if (Object.keys(registryIcons).length === 0) {\n    throw new Error(\"Something went wrong fetching the registry icons.\")","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/migrations/migrate-icons.ts#L85-L121","documentation":"Thrown by migrateIcons after fast-glob returns an empty array for a user-supplied --path. The path/glob was syntactically valid and resolved against config.resolvedPaths.cwd, but matched zero files. This is a preflight check before any icon migration work begins, ensuring the migration loop has targets.","triggerScenarios":"Running `shadcn migrate icons --path <glob-or-file>` where the value is a glob (contains '*') that fast-glob expands to nothing, or a directory containing no .js/.ts/.jsx/.tsx files. Also triggered when the path is a directory whose only matching files are excluded by the '**/node_modules/**' ignore rule.","commonSituations":"Typo in the glob pattern; pointing at a directory of .vue/.svelte files; running from the wrong working directory so config.resolvedPaths.cwd resolves outside the intended tree; passing a path that only matches files inside node_modules.","solutions":["Verify the path/glob is relative to the project root (config.resolvedPaths.cwd), not an absolute path or relative to the ui directory.","Run `ls <path>` or `find . -path './node_modules' -prune -o -name '*.tsx' -print` to confirm files exist and are not all under node_modules.","If migrating non-JS extensions is intended, note the glob is hardcoded to '**/*.{js,ts,jsx,tsx}' for directories — point --path at specific files instead.","Re-run from the project root or fix components.json `cwd` so resolvedPaths.cwd points where your source lives."],"exampleFix":"// before\nshadcn migrate icons --path ./src/components/**/*.vue\n\n// after — point at files the migrator globs for, or pass explicit files\nshadcn migrate icons --path ./src/components/button.tsx\nshadcn migrate icons --path 'src/**/*.tsx'","handlingStrategy":"validation","validationCode":"import fg from 'fast-glob'\nimport path from 'path'\n\nasync function assertPathHasFiles(input: string, cwd: string) {\n  const isGlob = input.includes('*')\n  let files: string[]\n  if (isGlob) {\n    files = await fg(input, { cwd, onlyFiles: true, ignore: ['**/node_modules/**'] })\n  } else {\n    const stat = await fs.stat(path.resolve(cwd, input)).catch(() => null)\n    if (!stat) throw new Error(`File not found: ${input}`)\n    files = stat.isDirectory()\n      ? await fg('**/*.{js,ts,jsx,tsx}', { cwd: path.resolve(cwd, input), onlyFiles: true, ignore: ['**/node_modules/**'] })\n      : [input]\n  }\n  if (files.length === 0) throw new Error(`No files found matching: ${input}`)\n  return files\n}\n\n// call before migrateIcons({ path: input })\nawait assertPathHasFiles(options.path, config.resolvedPaths.cwd)","typeGuard":"function isValidPathInput(p: unknown): p is string {\n  return typeof p === 'string' && p.length > 0 && !p.includes('\\\\x00')\n}","tryCatchPattern":"try {\n  await migrateIcons(config, { path: input, yes: true })\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('No files found matching:')) {\n    logger.warn(`Skipping migration: ${e.message}`)\n  } else {\n    throw e\n  }\n}","preventionTips":["Always resolve paths relative to config.resolvedPaths.cwd, not process.cwd().","In CI, run an `ls` or `fd` check on the glob before invoking the migrator.","Remember the migrator only scans .js/.ts/.jsx/.tsx inside directories — point at specific files for other extensions."],"tags":["migration","icons","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"}