Troubleshooting Guide

This document covers common issues, errors, and their solutions when working at Innox Technologies

Table of Contents

  • Development Issues

  • Build Errors

  • TypeScript Errors

  • Chakra UI v3 Issues

  • Authentication Issues

  • Performance Issues

  • Deployment Issues

  • Getting Help

Development Issues

Issue: "Module not found: Can't resolve '@/components/...'"

Symptoms:

  • Import errors for components

  • TypeScript errors even though files exist

  • Build fails with module resolution errors

Solutions:

  1. Check tsconfig.json paths:

  1. Restart TypeScript Server:

    • VS Code: Command Palette → "TypeScript: Restart TS Server"

    • Or restart VS Code entirely

  2. Clean and reinstall:

Issue: Changes not reflecting in dev server

Symptoms:

  • Code changes don't appear in browser

  • Hard refresh doesn't work

  • Old code still running

Solutions:

  1. Restart dev server:

  1. Clear .next cache:

  1. Check for turbopack issues:

Issue: Port 3000 already in use

Symptoms:

Solutions:

  1. Kill process on port 3000:

  1. Use different port:

Build Errors

Issue: "ReferenceError: document is not defined"

Symptoms:

  • Build fails with document/window undefined

  • Error during server-side rendering

Cause: Using browser APIs in Server Component

Solution:

Issue: "Server actions cannot be used in Client Components"

Symptoms:

Solution:

Issue: "Module not found: Package subpaths not defined"

Symptoms:

Solution: Check Next.js version and package.json exports

TypeScript Errors

Issue: "Property 'X' does not exist on type 'Y'"

Symptoms:

  • TypeScript errors on Chakra UI components

  • Type mismatches

Solution for Chakra UI v3:

Issue: "Type 'X' is not assignable to type 'Y'"

Symptoms:

  • Type errors on props

  • Variant/colorPalette errors

Solution:

Issue: "Cannot find module 'next-auth'"

Symptoms:

  • Import errors for next-auth

  • Type errors

Solution:

Chakra UI v3 Issues

Issue: "Property 'Provider' does not exist"

Symptoms:

Cause: Chakra UI v3 has different exports

Solution:

Issue: "Property 'Avatar' does not exist"

Symptoms:

  • Avatar component not found

  • Switch component not found

Cause: These components don't exist in Chakra UI v3

Solution:

Issue: "Property 'bgPalette' does not exist"

Symptoms:

  • Props like bgPalette not recognized

  • fallbackSrc not working

Solution:

Issue: How to check available Chakra v3 exports

Solution:

Authentication Issues

Issue: "Invalid next-auth config"

Symptoms:

  • Auth not working

  • Login fails silently

Solutions:

  1. Check environment variables:

  1. Generate NEXTAUTH_SECRET:

  1. Check auth config:

Issue: "Session is always null"

Symptoms:

  • Session undefined in Server Components

  • useSession returns null

Solutions:

  1. Check middleware:

  1. Check session usage:

Issue: "Redirect not working after logout"

Symptoms:

  • Stays on same page after logout

  • Doesn't redirect to login

Solution:

Issue: "JWT token not including role"

Symptoms:

  • Session doesn't have user role

  • Role checks fail

Solution:

Performance Issues

Issue: Slow initial page load

Diagnosis:

Solutions:

  1. Use Server Components by default

  2. Lazy load heavy components:

  1. Optimize images:

Issue: Too many Client Components

Symptoms:

  • Large JavaScript bundle

  • Slow client-side hydration

Solution:

Issue: Slow Server Actions

Diagnosis:

Solutions:

  1. Parallelize independent operations:

  1. Add database indexes (when using DB)

  2. Cache results where appropriate

Deployment Issues

Issue: Build fails on Vercel

Symptoms:

  • Works locally, fails on Vercel

  • Type errors in production build

Solutions:

  1. Check TypeScript version:

  1. Ensure all env vars are set:

  • Go to Vercel project settings

  • Add NEXTAUTH_URL and NEXTAUTH_SECRET

  1. Check build logs:

Issue: "NEXTAUTH_URL mismatch"

Symptoms:

  • Auth fails in production

  • Redirect loops

Solution:

Issue: Static generation fails

Symptoms:

  • Pages not generating statically

  • Build timeout

Solution:

Debugging Tips

Enable Debug Mode

NextAuth:

Next.js:

Check Server Action Logs

Network Tab

  1. Open Chrome DevTools

  2. Go to Network tab

  3. Filter by "fetch"

  4. Look for Server Action calls

  5. Check request/response payloads

React DevTools

  1. Install React DevTools extension

  2. Check component props

  3. Look for unnecessary re-renders

  4. Verify Server vs Client Components

Common Mistakes

1. Forgetting "use client"

2. Using fetch in Server Components

3. Not handling ActionResult

4. Hardcoding colors

Getting Help

1. Check Documentation

  • ONBOARDING.md - Setup and development

  • ARCHITECTURE.md - System design

  • CODE_PATTERNS.md - Coding conventions

2. Search Existing Issues

Before creating new issues, search:

  • GitHub issues

  • Internal documentation

  • Stack Overflow

3. Debug Steps

  1. Reproduce the issue consistently

  2. Isolate the problem - create minimal reproduction

  3. Check console logs - browser and terminal

  4. Check network tab - failed requests

  5. Try clean build:

4. Ask for Help

When asking for help, provide:

  • What you tried: Steps you took

  • Expected behavior: What should happen

  • Actual behavior: What actually happened

  • Error messages: Full error stack traces

  • Environment: Node version, OS, browser

  • Code sample: Minimal reproduction

5. Create Issue

Include in your issue:

  • Clear title

  • Description

  • Steps to reproduce

  • Expected vs actual behavior

  • Screenshots (if applicable)

  • Code snippets

  • Environment details

Quick Reference

Reset Everything

Check Versions

Useful Commands

Environment Check


Still stuck? Reach out to the team or create an issue with details about your problem.

Last updated