shadcn-ui/ui · error
No files found matching: ${options.path}
Error message
No files found matching: ${options.path} What it means
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.
Source
Thrown at packages/shadcn/src/migrations/migrate-radix.ts:143
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(
"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."
)
}
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 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.
Example fix
// before shadcn migrate radix --path './src/legacy/**/*.bak' // after shadcn migrate radix --path './src/components/**/*.tsx'
Defensive patterns
Strategy: validation
Validate before calling
import fg from 'fast-glob'
import path from 'path'
async function assertGlobHasMatches(input: string, cwd: string) {
const files = await fg(input.includes('*') ? input : '**/*.{js,ts,jsx,tsx}', {
cwd: input.includes('*') ? cwd : path.resolve(cwd, input),
onlyFiles: true,
ignore: ['**/node_modules/**']
})
if (files.length === 0) throw new Error(`No files found matching: ${input}`)
}
await assertGlobHasMatches(options.path, config.resolvedPaths.cwd) Try / catch
try {
await migrateRadix(config, { path: input, yes: true })
} catch (e) {
if (e instanceof Error && e.message.startsWith('No files found matching:')) {
logger.warn(`Nothing to migrate for ${input}`)
} else throw e
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Typo in glob; pointing at a non-JS source tree; running from the wrong directory; pointing at an empty directory.
Related errors
- No files found matching: ${options.path}
- File not found: ${options.path}
- No files found matching: ${options.path}
- Unsupported path type: ${options.path}
- We could not find a valid `ui` path in your `components.json
AI-assisted analysis of shadcn-ui/ui@efac598707 (2026-08-12).
Data as JSON: /api/errors/3a118ee28956c1e0.
Report an issue: GitHub.