shadcn-ui/ui · error
No files found matching: ${options.path}
Error message
No files found matching: ${options.path} What it means
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.
Source
Thrown at packages/shadcn/src/migrations/migrate-rtl.ts:63
throw new Error(`File not found: ${options.path}`)
}
if (stat.isDirectory()) {
basePath = fullPath
files = await fg("**/*.{js,ts,jsx,tsx}", {
cwd: basePath,
onlyFiles: true,
ignore: ["**/node_modules/**"],
})
} else if (stat.isFile()) {
files = [options.path]
} else {
throw new Error(`Unsupported path type: ${options.path}`)
}
}
if (files.length === 0) {
throw new Error(`No files found matching: ${options.path}`)
}
} else {
// Default: use ui path from components.json.
if (!config.resolvedPaths.ui) {
throw new Error(
"Could not find a valid `ui` path in your `components.json`. Please provide a path or glob pattern."
)
}
basePath = config.resolvedPaths.ui
files = await fg("**/*.{js,ts,jsx,tsx}", {
cwd: basePath,
onlyFiles: true,
})
}
// Confirm with user.
if (!options.yes) {View on GitHub (pinned to efac598707)
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.
Example fix
// before shadcn migrate rtl --path './legacy/**/*.html' // after shadcn migrate rtl --path './src/**/*.tsx'
Defensive patterns
Strategy: validation
Validate before calling
import fg from 'fast-glob'
import path from 'path'
async function assertRtlPathHasFiles(input: string, cwd: string) {
const isGlob = input.includes('*')
const files = isGlob
? await fg(input, { cwd, onlyFiles: true, ignore: ['**/node_modules/**'] })
: await fg('**/*.{js,ts,jsx,tsx}', { cwd: path.resolve(cwd, input), onlyFiles: true, ignore: ['**/node_modules/**'] })
if (files.length === 0) throw new Error(`No files found matching: ${input}`)
}
await assertRtlPathHasFiles(options.path, config.resolvedPaths.cwd) Try / catch
try {
await migrateRtl(config, { path: input, yes: true })
} catch (e) {
if (e instanceof Error && e.message.startsWith('No files found matching:')) {
logger.warn(`Nothing to transform for ${input}`)
} else throw e
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Typo in glob; non-JS source tree; empty target directory; wrong working directory.
Related errors
- No files found matching: ${options.path}
- No files found matching: ${options.path}
- File not found: ${options.path}
- File not found: ${options.path}
- Unsupported path type: ${options.path}
AI-assisted analysis of shadcn-ui/ui@efac598707 (2026-08-12).
Data as JSON: /api/errors/90aa7749fc0c77fb.
Report an issue: GitHub.