shadcn-ui/ui · warning

Unsupported path type: ${options.path}

Error message

Unsupported path type: ${options.path}

What it means

fs.stat succeeded for --path but the entry is neither a regular file nor a directory — e.g., a socket, FIFO, character/block device, or a symlink whose target follows to a non-file/dir. The migrate-icons walker only handles files and directories.

Source

Thrown at packages/shadcn/src/migrations/migrate-icons.ts:98

    } else {
      const fullPath = path.resolve(basePath, options.path)
      const stat = await fs.stat(fullPath).catch(() => null)

      if (!stat) {
        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 {
    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,
    })
  }

View on GitHub (pinned to efac598707)

Solutions

  1. Point --path at a regular file or a directory instead.
  2. Remove or avoid the special file in the path.
  3. If a broken symlink, fix or delete it.
Defensive patterns

Strategy: type-guard

Validate before calling

import fs from "fs-extra"
import path from "path"

async function assertMigratablePath(configCwd: string, p: string) {
  const stat = await fs.stat(path.resolve(configCwd, p)).catch(() => null)
  if (!stat || (!stat.isFile() && !stat.isDirectory())) {
    throw new Error(`Unsupported path type: ${p}`)
  }
}

Type guard

import fs from "fs-extra"
import path from "path"

async function isMigratablePath(configCwd: string, p: string): Promise<boolean> {
  const stat = await fs.stat(path.resolve(configCwd, p)).catch(() => null)
  return !!stat && (stat.isFile() || stat.isDirectory())
}

Prevention

When it happens

Trigger: Pointing `shadcn migrate icons --path <p>` at a special filesystem entry: named pipe, unix socket, device node, or a broken symlink whose stat reports a non-file/non-dir type.

Common situations: Pointing at a node_modules internal socket, an OS device file under /dev, a broken symlink, or an unusual file type reported by a FUSE mount.

Related errors


AI-assisted analysis of shadcn-ui/ui@efac598707 (2026-08-12). Data as JSON: /api/errors/37d56bdcdfd93c42. Report an issue: GitHub.