Bug: Broken barrel exports in ui/index.jsx and ui/all.jsx #53

Closed
opened 2026-05-17 17:24:16 -05:00 by null · 0 comments
Owner

Problem

Two barrel export files (src/components/ui/index.jsx and src/components/ui/all.jsx) are broken and would fail if anyone imported from them.

index.jsx issues

  1. Default export imports for named-only exports — Every export { default as X } from './X.jsx' line assumes default exports, but none of these components have default exports. They all use named exports only (e.g., export { Button }, export { Card, CardHeader, ... }).
  2. Missing files — Imports reference CardContent.jsx, CardHeader.jsx, CardTitle.jsx, CardFooter.jsx which don't exist as separate files. These components are only defined inside Card.jsx.
  3. CardDescription duplicateCardDescription is exported from both Card.jsx and CardDescription.jsx. The index.jsx imports from CardDescription.jsx (which works) but all.jsx imports from Card.jsx.
  4. Sheet and Dialog have no default exports — Both use named exports only, but index.jsx tries export { default as Sheet, ... } which will fail.

all.jsx issues

  1. Same default-export assumption problem.
  2. Imports CardDescription from Card.jsx instead of CardDescription.jsx.

Impact

Currently no runtime impact because no files import from index.jsx or all.jsx — all pages import directly from individual component files. But if anyone adds an import like import { Button } from '@/components/ui', it will break the build.

Fix

Either:

  1. Delete both files — they're dead code and nothing uses them.
  2. Fix them — convert to proper named re-exports:
export { Button } from './Button.jsx'
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from './Card.jsx'
// etc.

Option 1 (delete) is recommended since the direct imports work fine.

## Problem Two barrel export files (`src/components/ui/index.jsx` and `src/components/ui/all.jsx`) are broken and would fail if anyone imported from them. ### `index.jsx` issues 1. **Default export imports for named-only exports** — Every `export { default as X } from './X.jsx'` line assumes default exports, but none of these components have default exports. They all use named exports only (e.g., `export { Button }`, `export { Card, CardHeader, ... }`). 2. **Missing files** — Imports reference `CardContent.jsx`, `CardHeader.jsx`, `CardTitle.jsx`, `CardFooter.jsx` which don't exist as separate files. These components are only defined inside `Card.jsx`. 3. **CardDescription duplicate** — `CardDescription` is exported from both `Card.jsx` and `CardDescription.jsx`. The `index.jsx` imports from `CardDescription.jsx` (which works) but `all.jsx` imports from `Card.jsx`. 4. **Sheet and Dialog have no default exports** — Both use named exports only, but `index.jsx` tries `export { default as Sheet, ... }` which will fail. ### `all.jsx` issues 1. Same default-export assumption problem. 2. Imports `CardDescription` from `Card.jsx` instead of `CardDescription.jsx`. ## Impact Currently **no runtime impact** because no files import from `index.jsx` or `all.jsx` — all pages import directly from individual component files. But if anyone adds an import like `import { Button } from '@/components/ui'`, it will break the build. ## Fix Either: 1. **Delete both files** — they're dead code and nothing uses them. 2. **Fix them** — convert to proper named re-exports: ```jsx export { Button } from './Button.jsx' export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from './Card.jsx' // etc. ``` Option 1 (delete) is recommended since the direct imports work fine.
null added the
P3 Low
bug
frontend
labels 2026-05-17 17:30:43 -05:00
null closed this issue 2026-05-17 17:47:00 -05:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: null/Queue-North-Website#53
No description provided.