Troubleshooting Guide¶
Breadcrumbs: Documentation > Guides > Troubleshooting
This guide provides solutions to common issues you may encounter while developing or deploying the portfolio website.
Table of Contents¶
- Development Issues
- Build Issues
- Deployment Issues
- Content Issues
- Performance Issues
- SEO Issues
- Environment Issues
- Database/Content Issues
Development Issues¶
Issue: Development server won't start¶
Symptoms:
Solution:
- Reinstall dependencies:
- Clear Next.js cache:
- Check Node.js version:
If version is too low, upgrade Node.js:
Issue: Module not found errors¶
Symptoms:
Solution:
- Check
tsconfig.jsonhas correct path aliases:
- Restart TypeScript server in VS Code:
- Press
Cmd/Ctrl + Shift + P - Type "TypeScript: Restart TS Server"
-
Select and run
-
Restart development server:
Issue: Hot reload not working¶
Symptoms:
- Changes to files don't reflect in browser
- Must manually refresh to see changes
Solution:
- Check file watchers limit (Linux/WSL):
# Check current limit
cat /proc/sys/fs/inotify/max_user_watches
# Increase limit
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
- Restart development server with Turbopack:
-
Check for TypeScript errors:
-
Fix any TypeScript errors in the console
- Errors can prevent hot reload
Issue: Styles not applying correctly¶
Symptoms:
- Tailwind classes not working
- Components look unstyled
- Dark mode not working
Solution:
- Check Tailwind CSS configuration:
// tailwind.config.ts
content: [
'./pages/**/*.{ts,tsx}',
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
'./src/**/*.{ts,tsx}',
],
- Verify CSS imports:
- Check dark mode configuration:
-
Clear browser cache:
-
Open DevTools (F12)
- Right-click refresh button
-
Select "Empty Cache and Hard Reload"
-
Rebuild Tailwind:
Issue: TypeScript errors in components¶
Symptoms:
Solution:
- Check interface definitions:
- Verify type imports:
- Restart TypeScript server (see above)
Build Issues¶
Issue: Build fails with TypeScript errors¶
Symptoms:
Solution:
- Run type checking locally:
-
Fix all type errors - No
anyworkarounds in production -
Check for unused imports:
Issue: Build fails with "Out of memory"¶
Symptoms:
Solution:
- Increase Node.js memory:
- Check for circular dependencies:
- Optimize imports:
// ❌ BAD: Imports entire library
import { Button } from "@/components/ui";
// ✅ GOOD: Specific import
import { Button } from "@/components/ui/button";
Issue: Build succeeds but pages are blank¶
Symptoms:
npm run buildsucceeds- Deployed site shows blank pages
- Console shows errors
Solution:
- Check environment variables:
- Check for client-only code in server components:
// ❌ BAD: Using browser APIs in server component
export default function Page() {
const width = window.innerWidth; // Error!
return <div>{width}</div>;
}
// ✅ GOOD: Use client component
'use client';
export default function Page() {
const width = window.innerWidth;
return <div>{width}</div>;
}
-
Check console for errors:
-
Open browser DevTools (F12)
- Look for errors in Console tab
- Fix any runtime errors
Issue: Static generation fails¶
Symptoms:
Solution:
// app/projects/[slug]/page.tsx
import { getProjects } from "@/lib/projects";
export async function generateStaticParams() {
const projects = await getProjects();
return projects.map((project) => ({
slug: project.slug,
}));
}
Deployment Issues¶
Issue: Docker build fails¶
Symptoms:
Solution:
- Check Dockerfile syntax:
FROM node:20-alpine AS base
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
CMD ["npm", "start"]
- Check Docker Compose configuration:
version: "3.8"
services:
website-prod:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
NODE_ENV: production
- Rebuild without cache:
Issue: Deployed site shows 404 errors¶
Symptoms:
- Home page works
- Other pages show 404
Solution:
- Check Next.js output mode:
- Verify file structure in build:
- Check server configuration - Ensure all routes are handled by Next.js
Issue: Environment variables not working¶
Symptoms:
- Site loads but features don't work
- Console shows "undefined" for config values
Solution:
- Check variable prefix:
# ✅ GOOD: Available in browser
NEXT_PUBLIC_SITE_URL="https://example.com"
# ❌ BAD: Only available server-side
SITE_URL="https://example.com"
- Rebuild after changing environment variables:
- Verify in Docker Compose:
services:
website-prod:
environment:
- NEXT_PUBLIC_SITE_URL=https://example.com
- NODE_ENV=production
Content Issues¶
Issue: Project not showing up¶
Symptoms:
- Created
my-project.json - Project doesn't appear on
/projectspage
Checklist:
- File location correct?
- Valid JSON?
- Required fields present?
{
"title": "Project Title",
"shortDescription": "Brief description",
"description": "Long description",
"technologies": ["Next.js"],
"images": []
}
- Restart development server:
Issue: Project images not displaying¶
Symptoms:
- Images show broken icon
- 404 error in console
Solution:
- Check image path:
{
"images": [
{
"src": "/images/projects/my-project/screenshot.jpg",
"alt": "Screenshot description"
}
]
}
- Verify file exists:
- Check file permissions:
-
Supported formats:
-
Images:
.jpg,.jpeg,.png,.webp,.gif - Videos:
.mp4,.webm,.mov
Issue: Project order not working¶
Symptoms:
- Set
"order": 1but project appears in wrong position
Solution:
- Check order values:
// Featured projects: order 1-6
{
"order": 1 // Will appear first
}
// Non-featured projects: no order field or order > 6
{
// No order field - sorted alphabetically
}
- Verify in code:
// lib/projects.ts sorts by order, then alphabetically
export async function getProjects(): Promise<Project[]> {
return projects.sort((a, b) => {
if (a.order !== undefined && b.order !== undefined) {
return a.order - b.order;
}
// ...
});
}
Performance Issues¶
Issue: Slow page loads¶
Symptoms:
- Pages take > 3 seconds to load
- Large JavaScript bundles
Solution:
- Analyze bundle size:
- Optimize images:
// Use Next.js Image component
import Image from 'next/image';
<Image
src="/images/profile.jpg"
alt="Profile"
width={500}
height={500}
priority // For above-the-fold images
/>
- Lazy load components:
import dynamic from 'next/dynamic';
const ProjectGallery = dynamic(() => import('@/components/project-gallery'), {
loading: () => <p>Loading...</p>,
});
- Enable caching:
// app/api/route.ts
export async function GET() {
return new Response(content, {
headers: {
"Cache-Control": "public, max-age=86400",
},
});
}
Issue: Large bundle size¶
Symptoms:
- Build output shows large chunks
- Slow initial page load
Solution:
- Check bundle analyzer:
- Split large dependencies:
// next.config.mjs
const nextConfig = {
experimental: {
optimizePackageImports: ["@radix-ui/react-dialog", "lucide-react"],
},
};
- Remove unused dependencies:
SEO Issues¶
Issue: Sitemap not generating¶
Symptoms:
/sitemap.xmlreturns 404
Solution:
- Check sitemap file exists:
- Verify build output:
- Check deployment:
Issue: Metadata not appearing¶
Symptoms:
- Page title is wrong
- Description missing in search results
Solution:
- Check metadata exports:
// app/page.tsx
import { Metadata } from "next";
export const metadata: Metadata = {
title: "Page Title",
description: "Page description",
};
-
Verify in browser:
-
View page source (Ctrl+U)
-
Search for
<title>and<meta name="description"> -
Check template:
// app/layout.tsx
export const metadata: Metadata = {
title: {
template: "%s | Software Engineer & AI",
default: "Simon Stijnen | Software Engineer & AI",
},
};
Issue: Robots.txt not working¶
Symptoms:
- Search engines not crawling site
Solution:
- Check robots file:
// app/robots.ts
export default function robots() {
return {
rules: {
userAgent: "*",
allow: "/",
},
sitemap: "https://your-domain.com/sitemap.xml",
};
}
- Test robots.txt:
Environment Issues¶
Issue: .env not loading¶
Symptoms:
- Environment variables are undefined
Solution:
- Check file name:
- Restart development server:
- Check variable usage:
// ✅ GOOD: Public variables
const url = process.env.NEXT_PUBLIC_SITE_URL;
// ❌ BAD: Private variables in client components
("use client");
const secret = process.env.SECRET_KEY; // Undefined!
Database/Content Issues¶
Issue: JSON parsing errors¶
Symptoms:
Solution:
- Validate JSON:
- Common JSON mistakes:
// ❌ BAD: Trailing comma
{
"title": "Project",
"technologies": ["React"],
}
// ✅ GOOD: No trailing comma
{
"title": "Project",
"technologies": ["React"]
}
// ❌ BAD: Single quotes
{
'title': 'Project'
}
// ✅ GOOD: Double quotes
{
"title": "Project"
}
-
Use a JSON validator:
-
Online: jsonlint.com
- Editor: Install JSON validation extension
Getting More Help¶
If you're still experiencing issues:
- Check GitHub Issues:
- Search for similar issues
-
Open a new issue if needed
-
Enable debug logging:
- Check Next.js documentation:
- Next.js Docs
-
Inspect build output:
See Also¶
- Contributing Guide - Development workflow
- Best Practices - Code patterns
- Architecture Overview - Project structure
- Deployment Guide - Deployment setup
Next Steps¶
- Review common solutions above
- Check logs for error details
- Search GitHub issues
- Open a new issue if problem persists
Last Updated: February 2026
Maintainers: Simon Stijnen
Need Help? Open an issue on GitHub