ShadCN UI component installation workflow for Wasp projects. Use when installing ShadCN components, fixing import errors, or working with UI components...
When to use this skill:
ONLY USE: ShadCN v2.3.0
Why: Newer versions require Tailwind v4, which is incompatible with Wasp.
npx shadcn@2.3.0 add button
# Replace 'button' with desired component name
CRITICAL: Always use @2.3.0 version lock
This fix is REQUIRED for EVERY component installation!
File location: app/src/client/components/ui/{component}.tsx
Before (WRONG):
import { cn } from "s/lib/utils";
After (CORRECT):
import { cn } from "../../lib/utils";
Why: ShadCN generates wrong import path. Must fix manually.
import { Button } from '@/components/ui/button'
<Button variant="default">Click me</Button>
Common components to install:
All ShadCN components go in:
app/src/client/components/ui/
├── button.tsx
├── card.tsx
├── dialog.tsx
└── ...
Cause: Forgot to fix import path after installation
Fix: Change import in component file:
-import { cn } from "s/lib/utils"
+import { cn } from "../../lib/utils"
Cause: Wrong import path or missing Tailwind config
Fix:
tailwind.config.js has ShadCN configCause: Used wrong version (not v2.3.0)
Fix: Uninstall and reinstall with correct version:
rm app/src/client/components/ui/{component}.tsx
npx shadcn@2.3.0 add {component}
After EVERY component installation:
npx shadcn@2.3.0 add {component}s/lib/utils to ../../lib/utils✅ DO:
❌ NEVER:
# 1. Install
npx shadcn@2.3.0 add button
# 2. Fix import in app/src/client/components/ui/button.tsx
# Change: import { cn } from "s/lib/utils"
# To: import { cn } from "../../lib/utils"
# 3. Use
import { Button } from '@/components/ui/button'
<Button>Click me</Button>
npx shadcn@2.3.0 add button card dialog
# Then fix import path in ALL THREE files:
# - app/src/client/components/ui/button.tsx
# - app/src/client/components/ui/card.tsx
# - app/src/client/components/ui/dialog.tsx
If components don't work after installation:
npm list shadcn-ui../scripts/safe-start.sh (multi-worktree safe)