Skip to content

fix(registry): safeguard instanceof File checks in upload component and examples - #152

Merged
ladparth merged 1 commit into
mainfrom
fix/upload-file-shadowing
May 27, 2026
Merged

fix(registry): safeguard instanceof File checks in upload component and examples#152
ladparth merged 1 commit into
mainfrom
fix/upload-file-shadowing

Conversation

@ladparth

Copy link
Copy Markdown
Contributor

Description

Safeguard the instanceof File checks in the shadcn upload registry component and its examples. This prevents name clashes and runtime errors if File is imported as an icon package (e.g. lucide-react) within the same file or scope.

Key Changes

Docs / Web (apps/web)

  • Updated apps/web/registry/shadcn/fields/upload.tsx to guard the global File check with typeof window !== "undefined" && item instanceof window.File.
  • Applied the same safety guard to gallery-upload-form.tsx, document-upload-form.tsx, and profile-upload-form.tsx examples.
  • Rebuilt the shadcn registry json files under apps/web/public/r/ using npx shadcn build.

Type of change

  • feat (New feature)
  • fix (Bug fix)
  • docs (Documentation changes)
  • refactor (Refactoring code without changing behavior)
  • test (Adding or updating tests)
  • chore (Maintenance, CI/CD, or Ops-related changes)

Related Issues

@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
buzzform Ready Ready Preview, Comment May 27, 2026 11:47am

@ladparth ladparth self-assigned this May 27, 2026
@ladparth
ladparth merged commit d0fc403 into main May 27, 2026
3 checks passed
@ladparth
ladparth deleted the fix/upload-file-shadowing branch May 27, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] File / media upload field

1 participant