{"record":{"id":"90aa7749fc0c77fb","repo":"shadcn-ui/ui","slug":"no-files-found-matching-options-path-90aa77","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-rtl.ts","lineNumber":63,"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        \"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,\n    })\n  }\n\n  // Confirm with user.\n  if (!options.yes) {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/migrations/migrate-rtl.ts#L45-L81","documentation":"Thrown by migrateRtl when fast-glob returns an empty array for a user-supplied --path. The glob/path was valid but matched zero migratable files. The migrator refuses to proceed with nothing to transform.","triggerScenarios":"A glob matching nothing; a directory containing no .js/.ts/.jsx/.tsx files; everything matched is under node_modules and ignored; running from the wrong cwd so the relative path misses.","commonSituations":"Typo in glob; non-JS source tree; empty target directory; wrong working directory.","solutions":["Confirm files match: `ls <glob>` relative to config.resolvedPaths.cwd.","Verify the path is relative to the project root.","Point at specific files if the directory only contains non-JS code."],"exampleFix":"// before\nshadcn migrate rtl --path './legacy/**/*.html'\n\n// after\nshadcn migrate rtl --path './src/**/*.tsx'","handlingStrategy":"validation","validationCode":"import fg from 'fast-glob'\nimport path from 'path'\n\nasync function assertRtlPathHasFiles(input: string, cwd: string) {\n  const isGlob = input.includes('*')\n  const files = isGlob\n    ? await fg(input, { cwd, onlyFiles: true, ignore: ['**/node_modules/**'] })\n    : await fg('**/*.{js,ts,jsx,tsx}', { cwd: path.resolve(cwd, input), onlyFiles: true, ignore: ['**/node_modules/**'] })\n  if (files.length === 0) throw new Error(`No files found matching: ${input}`)\n}\n\nawait assertRtlPathHasFiles(options.path, config.resolvedPaths.cwd)","typeGuard":null,"tryCatchPattern":"try {\n  await migrateRtl(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 transform for ${input}`)\n  } else throw e\n}","preventionTips":["Verify globs match with `fd` before scripting.","Remember directory traversal is .js/.ts/.jsx/.tsx only.","Run from the project root so relative paths resolve as expected."],"tags":["migration","rtl","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"}