부록
C. 트러블슈팅

Appendix C: LinkHub Troubleshooting

Common issues and solutions encountered during LinkHub development.

Dev Environment Issues

SymptomCauseSolution
"command not found: node"Node.js not installedInstall Node.js and retry
"command not found: claude"Claude Code not installednpm install -g @anthropic-ai/claude-code
npm install failsNetwork or permission issuesudo npm install or check network
localhost:3000 not openingAnother process using portClose other terminals or change port

Database/Auth Issues

SymptomCauseSolution
Links not savingMissing RLS policyCheck INSERT policy in Supabase
Can't see my datauser_id mismatchCheck login session, RLS
Not redirecting to dashboard after loginRedirect URL errorCheck Supabase Auth settings
Social login failsOAuth config errorCheck Callback URL, keys
Profile page 404Username routing issueCheck dynamic routing setup

How to Check RLS Policies

-- Run in Supabase SQL Editor
SELECT * FROM pg_policies WHERE tablename = 'profiles';
SELECT * FROM pg_policies WHERE tablename = 'links';

Realtime/Analytics Issues

SymptomCauseSolution
Click count not increasingclicks INSERT failureCheck RLS policy, table structure
Live preview not workingRealtime not enabledCheck Supabase Realtime settings
Analytics data slowMissing indexAdd index on clicked_at, link_id

Deployment/Operations Issues

SymptomCauseSolution
Vercel build failsType error or dependencyTest local build before pushing
Environment variables not readingNot registered in VercelSettings → Environment Variables
CORS errorOrigin not allowedUse Next.js API routes (no CORS needed)
Stripe webhook failsSignature verification errorCheck raw body usage
Profile page slowSSR not optimizedApply ISR (Incremental Static Regeneration)

Correct Stripe Webhook Setup

// Next.js App Router
export async function POST(req: Request) {
  const body = await req.text(); // raw body
  const sig = req.headers.get('stripe-signature')!;
 
  const event = stripe.webhooks.constructEvent(
    body,
    sig,
    process.env.STRIPE_WEBHOOK_SECRET!
  );
 
  // Handle event...
}

Quick Solutions by Error Message

💡

"Module not found"

Run npm install

💡

"Port already in use"

Close server running in other terminal, or use a different port

💡

"ECONNREFUSED"

Check if server is running, verify URL is correct

💡

"Unauthorized" (401)

Check login status, check token expiration

💡

"Forbidden" (403)

Check RLS policies, check permissions


Solution for All Errors

Copy the entire error message and ask Claude "Explain why this error happened and how to fix it." Most issues get resolved!