Troubleshooting
Common issues and solutions when working with ShadcnStore blocks.
Installation Issues
Authentication Errors
Problem: Getting 401 or 403 errors when installing premium blocks.
Solutions:
Verify your license key:
- Check your license key is correct and active
- Visit your dashboard to confirm
Quote the URL properly:
bash# ✅ Correct - quoted URL npx shadcn@latest add "https://shadcnstore.com/r/[component].json?token=your_key" # ❌ Incorrect - unquoted URL with special characters npx shadcn@latest add https://shadcnstore.com/r/[component].json?token=your_key
Try different authentication methods:
bash# Method 1: Query parameter (recommended) npx shadcn@latest add "https://shadcnstore.com/r/[component].json?token=your_key" # Method 2: Environment variable export SHADCN_STORE_TOKEN="your_key" npx shadcn@latest add "https://shadcnstore.com/r/[component].json?token=$SHADCN_STORE_TOKEN"
Network Connection Issues
Problem: Unable to download components from the registry.
Solutions:
Check internet connection:
bash# Test connectivity ping shadcnstore.com curl -I https://shadcnstore.com
Corporate firewall/proxy:
- Check with your IT department about HTTPS access
- Configure npm proxy settings if needed:
bashnpm config set proxy http://proxy.company.com:8080 npm config set https-proxy http://proxy.company.com:8080
DNS issues:
bash# Try alternative DNS nslookup shadcnstore.com 8.8.8.8
File Permission Errors
Problem: Cannot write files to the components directory.
Solutions:
Check directory permissions:
bashls -la components/ chmod 755 components/
Run with appropriate permissions:
bash# macOS/Linux sudo npx shadcn@latest add [component] # Or fix ownership sudo chown -R $USER:$USER components/
Windows permissions:
- Run command prompt as administrator
- Check folder permissions in Properties
Configuration Issues
Invalid components.json
Problem: shadcn CLI cannot find or parse components.json
.
Solutions:
Initialize shadcn/ui:
bashnpx shadcn@latest init
Validate JSON syntax:
bash# Check for syntax errors cat components.json | jq .
Verify required fields:
json{ "style": "new-york", "rsc": true, "tailwind": { "config": "tailwind.config.js", "css": "app/globals.css", "baseColor": "neutral", "cssVariables": true }, "aliases": { "components": "@/components", "utils": "@/lib/utils" } }
Path Alias Issues
Problem: Import errors with @/
paths after installing blocks.
Solutions:
Check tsconfig.json paths:
json{ "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./*"], "@/components/*": ["./components/*"], "@/lib/*": ["./lib/*"] } } }
Verify aliases match components.json:
json// components.json { "aliases": { "components": "@/components", "utils": "@/lib/utils" } }
Framework-specific configuration:
Next.js: Paths are automatically handled
Vite:
ts// vite.config.ts export default defineConfig({ resolve: { alias: { "@": path.resolve(__dirname, "./src"), }, }, })
Create React App with CRACO:
js// craco.config.js const path = require('path') module.exports = { webpack: { alias: { '@': path.resolve(__dirname, 'src'), }, }, }
Styling Issues
Blocks Look Broken or Unstyled
Problem: Components appear without styling or with broken layout.
Solutions:
Check Tailwind CSS installation:
bash# Verify Tailwind is installed npm list tailwindcss # Reinstall if needed npm install -D tailwindcss postcss autoprefixer
Verify CSS imports:
css/* In your main CSS file */ @tailwind base; @tailwind components; @tailwind utilities; /* For Tailwind v4 */ @import "tailwindcss";
Check CSS variables:
css/* Ensure shadcn/ui CSS variables are defined */ :root { --background: oklch(1 0 0); --foreground: oklch(0.145 0 0); --primary: oklch(0.205 0 0); /* ... other variables */ }
Verify Tailwind config:
js// tailwind.config.js module.exports = { darkMode: ["class"], content: [ './pages/**/*.{ts,tsx}', './components/**/*.{ts,tsx}', './app/**/*.{ts,tsx}', './src/**/*.{ts,tsx}', ], // ... rest of config }
Dark Mode Not Working
Problem: Dark mode styles not applying correctly.
Solutions:
Check dark mode configuration:
js// tailwind.config.js module.exports = { darkMode: ["class"], // Enable class-based dark mode }
Verify dark class application:
tsx// Should be applied to html or body element <html className="dark">
Check CSS variables for dark mode:
css.dark { --background: oklch(0.145 0 0); --foreground: oklch(0.985 0 0); /* ... other dark mode variables */ }
Theme provider setup:
tsximport { ThemeProvider } from "next-themes" <ThemeProvider attribute="class" defaultTheme="system"> {children} </ThemeProvider>
Responsive Design Issues
Problem: Blocks not responding correctly to screen size changes.
Solutions:
Check viewport meta tag:
html<meta name="viewport" content="width=device-width, initial-scale=1">
Verify responsive classes:
tsx// Check block uses responsive prefixes <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
Test with browser dev tools:
- Open responsive design mode
- Test various screen sizes
- Check for CSS conflicts
TypeScript Issues
Type Errors
Problem: TypeScript compilation errors when using blocks.
Solutions:
Install type dependencies:
bashnpm install -D @types/react @types/react-dom
Check import paths:
tsx// ✅ Correct import import { Button } from "@/components/ui/button" // ❌ Incorrect import import { Button } from "components/ui/button"
Verify TypeScript configuration:
json// tsconfig.json { "compilerOptions": { "moduleResolution": "bundler", "jsx": "preserve", "strict": true } }
Update dependencies:
bashnpm update @types/react @types/react-dom
Missing shadcn/ui Components
Problem: Blocks failing because required shadcn/ui components are missing.
Solutions:
Install required components:
bash# Check error message for missing components npx shadcn@latest add button card input
Install all common components:
bashnpx shadcn@latest add button input label card dialog dropdown-menu
Check component dependencies:
- Look at block documentation for required components
- Install dependencies before installing the block
Build Issues
Build Failures
Problem: Build process fails when including blocks.
Solutions:
Clear build cache:
bash# Next.js rm -rf .next # Vite rm -rf dist node_modules/.vite # General rm -rf node_modules package-lock.json npm install
Check for conflicting CSS:
- Remove duplicate Tailwind imports
- Check for CSS specificity conflicts
- Verify no conflicting global styles
Update build tools:
bashnpm update next vite @vitejs/plugin-react
Check Node.js version:
bashnode --version # Ensure Node.js 18+ for best compatibility
Bundle Size Issues
Problem: Large bundle sizes after adding blocks.
Solutions:
Analyze bundle:
bash# Next.js npm install @next/bundle-analyzer # Vite npm install rollup-plugin-visualizer
Code splitting:
tsximport { lazy, Suspense } from 'react' const HeavyBlock = lazy(() => import('@/components/heavy-block')) <Suspense fallback={<div>Loading...</div>}> <HeavyBlock /> </Suspense>
Tree shake unused code:
tsx// ✅ Import specific components import { Button } from "@/components/ui/button" // ❌ Avoid barrel imports if unused import * as UI from "@/components/ui"
Runtime Issues
Hydration Mismatches
Problem: Server and client render different content (SSR/SSG).
Solutions:
Use suppressHydrationWarning:
tsx<div suppressHydrationWarning> {/* Dynamic content */} </div>
Client-only rendering:
tsximport { useState, useEffect } from 'react' function ClientOnlyBlock() { const [mounted, setMounted] = useState(false) useEffect(() => { setMounted(true) }, []) if (!mounted) return null return <YourBlock /> }
Use dynamic imports:
tsximport dynamic from 'next/dynamic' const DynamicBlock = dynamic(() => import('@/components/block'), { ssr: false })
Performance Issues
Problem: Blocks causing performance problems.
Solutions:
Optimize images:
tsx// Use Next.js Image optimization import Image from 'next/image' <Image src="/hero.jpg" alt="Hero" width={800} height={600} priority />
Memoize expensive computations:
tsximport { useMemo } from 'react' function ExpensiveBlock({ data }) { const processedData = useMemo(() => { return data.map(item => /* expensive computation */) }, [data]) return <div>{/* render */}</div> }
Use React.memo for pure components:
tsximport { memo } from 'react' const PureBlock = memo(function PureBlock({ title, content }) { return <div>{title}: {content}</div> })
Getting Help
Before Reaching Out
- Check this troubleshooting guide
- Review the FAQ for common questions
- Search existing issues on GitHub
- Try with a minimal reproduction to isolate the issue
How to Get Help
- Community: Join our Discord community for help and discussions
- Support Email: Contact hello@shadcnstore.com
What to Include
When reporting issues, include:
- Environment details: OS, Node.js version, framework version
- Error messages: Full error text and stack traces
- Reproduction steps: Minimal code example
- Expected vs actual behavior: What should happen vs what happens
- Configuration files:
components.json
,tailwind.config.js
, etc.
Example Issue Report
## Bug Report
**Environment:**
- OS: macOS 13.0
- Node.js: 18.17.0
- Next.js: 13.4.19
- shadcn/ui: 0.8.0
**Issue:**
Hero block not displaying correctly in dark mode
**Reproduction:**
1. Install block
2. Enable dark mode
3. Text becomes unreadable
**Expected:** Text should be light in dark mode
**Actual:** Text remains dark and unreadable
**Code:**
Add your code here
**Screenshots:**
Attach any relevant screenshots or GIFs
Debugging Tips
Development Tools
- React Developer Tools: Debug component state and props
- Browser DevTools: Inspect CSS and network requests
- TypeScript compiler: Check for type errors
- ESLint/Prettier: Code quality and formatting
Common Debugging Steps
- Start with a clean installation
- Test with minimal code
- Check browser console for errors
- Verify all dependencies are installed
- Test in incognito/private mode
Remember: Most issues are configuration-related. Double-check your setup before assuming it's a bug! 🐛→🎯