Common Issues

This guide covers the most common problems and their solutions.

Installation Issues

Error: "Module not found"

Symptom:

Error: Cannot find module 'framer-motion'
Module not found: Can't resolve '@ai-sdk/google'

Cause: Missing dependencies or corrupted node_modules

Solution:

# Remove node_modules and lock file
rm -rf node_modules package-lock.json

# Clear npm cache
npm cache clean --force

# Reinstall dependencies
npm install

# Restart dev server
npm run dev

Error: "Node version not supported"

Symptom:

Cause: Node.js version is too old

Solution:

Error: "Port 3000 already in use"

Symptom:

Cause: Another process is using port 3000

Solution 1 - Use different port:

Solution 2 - Kill the process (macOS/Linux):

Solution 3 - Kill the process (Windows):

API & Environment Issues

Error: "API key not configured"

Symptom:

  • Chat doesn't work

  • Console shows API key errors

  • Blank responses

Solution:

  1. Create .env.local in root directory:

  1. Add your API key:

  1. Verify the variable name is exactly as shown (common typo)

  2. No quotes around the value

  3. Restart the dev server:

  1. Check file location - must be in root, not in app/ folder

Error: "API request failed"

Symptom:

Causes & Solutions:

1. Invalid API key:

  • Verify key is active

  • Generate new key if needed

  • Update .env.local

2. Rate limit exceeded:

  • Google AI free tier has limits

  • Wait 1 minute and try again

  • Consider upgrading API tier

3. Network issues:

  • Check internet connection

  • Disable VPN temporarily

  • Check firewall settings

4. API service down:

Environment variables not loading

Symptom: Variables work locally but not in production

Solution for Vercel:

  1. Go to Project → Settings → Environment Variables

  2. Add GOOGLE_GENERATIVE_AI_API_KEY

  3. Select all environments (Production, Preview, Development)

  4. Redeploy the project

Solution for local:

  1. Verify file is named .env.local exactly

  2. Restart dev server after changes

  3. Check .gitignore includes .env.local

Build Issues

Error: "Build failed"

Symptom:

Common causes:

1. Syntax errors:

2. Import errors:

3. Type errors (if using TypeScript):

4. Environment variables:

General solution:

Error: "Tailwind CSS not working"

Symptom:

  • No styles applied

  • Plain HTML appearance

  • Missing colors

Solution:

  1. Verify Tailwind installation:

  1. Check globals.css has:

  1. Verify import in layout.js:

  1. Clear cache and rebuild:

Runtime Issues

Cooldown doesn't work

Symptom: Can send multiple messages without waiting

Solution:

  1. Check browser console for JavaScript errors

  2. Verify localStorage is enabled:

  1. Clear localStorage:

  1. Refresh the page and try again

Cooldown stuck at 50 seconds

Symptom: Countdown never decreases

Solution:

  1. Check browser console for errors

  2. Clear localStorage:

  1. Refresh the page

  2. Check useEffect is working:

Messages not displaying

Symptom:

  • Send message but nothing appears

  • Blank chat area

  • No error messages

Solution:

  1. Check browser console for errors

  2. Verify API is responding:

  1. Check network tab in DevTools:

  • Is request being sent?

  • What's the response status?

  • Any errors?

  1. Verify useChat hook is working:

Streaming responses are slow

Symptom: AI takes 30+ seconds to respond

Causes & Solutions:

1. Web search is slow (expected):

  • Searches take 5-15 seconds

  • This is normal for real-time data

  • Consider reducing search requirements

2. Large max tokens:

3. Network latency:

  • Check internet speed

  • Try different network

  • Disable VPN

4. Google AI API slow:

  • Try at different time

  • Check API status

  • Consider different region

UI Issues

Matrix rain causing lag

Symptom: Animations are choppy, page is slow

Solution 1 - Disable on mobile:

Solution 2 - Reduce complexity:

Solution 3 - Remove completely:

Styles not updating

Symptom: CSS changes don't appear

Solution:

  1. Hard refresh browser:

    • Chrome/Firefox: Ctrl+Shift+R (Cmd+Shift+R on Mac)

    • Safari: Cmd+Option+R

  2. Clear .next folder:

  1. Check Tailwind classes are correct:

Icons not showing

Symptom: Square boxes instead of icons

Solution:

  1. Verify lucide-react is installed:

  1. Check import:

  1. Clear cache and reinstall:

Deployment Issues

Vercel build fails

Symptom: Deployment fails with build errors

Solution:

  1. Test build locally first:

  1. Check build logs in Vercel Dashboard

  2. Verify environment variables are added

  3. Ensure Node version matches:

  1. Check for ESLint errors:

Function timeout on Vercel

Symptom:

Cause: Vercel Hobby plan has 10-second limit

Solutions:

Option 1 - Upgrade to Pro ($20/month):

  • 60-second limit

  • Better support

  • More resources

Option 2 - Reduce timeout:

Then adjust cooldown in app/app/page.js to match.

Option 3 - Use different host:

  • Railway

  • Render

  • Self-hosted

Domain not working

Symptom: Custom domain doesn't load

Solution:

  1. Wait 24-48 hours for DNS propagation

  2. Verify DNS records:

  1. Check DNS propagation:

  1. Verify in Vercel Dashboard:

  • Settings → Domains

  • Check for error messages

  • SSL certificate status

Performance Issues

Page loads slowly

Optimization checklist:

  1. Optimize images:

  1. Reduce animations:

  1. Code splitting:

  1. Analyze bundle:

High API costs

Symptom: Google AI bill is high

Solutions:

  1. Reduce max tokens:

  1. Implement caching:

  1. Increase cooldown:

  1. Monitor usage:

  • Check Google AI Studio quota

  • Set up billing alerts

  • Track usage per day

Getting More Help

If your issue isn't listed here:

  1. Check the logs:

    • Browser console

    • Terminal output

    • Vercel logs (if deployed)

  2. Search GitHub Issues:

  3. Ask for help:


Still stuck? Open an issue with detailed information and we'll help you out!

Last updated