Developer Errors & Solutions
Detailed, step-by-step guides with root cause analyses, terminal commands, copyable code fixes, and prevention tips for real programming exceptions and compiler errors.
Spring Boot Port 8080 Already in Use
Fix WebServerException: Port 8080 was already in use by killing the conflicting process or assigning a custom port.
Spring Boot Ambiguous Handler Methods
Resolve IllegalStateException: Ambiguous mapping caused by duplicate @GetMapping or @PostMapping path signatures.
Spring Boot Failed to Configure DataSource
Fix 'Failed to configure a DataSource: url attribute is not specified and no embedded datasource could be configured'.
Spring Boot Bean Creation Exception
Troubleshoot BeanCreationException: Error creating bean with name and UnsatisfiedDependencyException in Spring context.
Java NullPointerException (NPE)
Identify the root cause of java.lang.NullPointerException and prevent it using Optional, Objects, and modern Java patterns.
Java ClassNotFoundException
Diagnose java.lang.ClassNotFoundException and NoClassDefFoundError across classpaths, Maven, and runtime loaders.
Java OutOfMemoryError: Java Heap Space
Diagnose java.lang.OutOfMemoryError: Java heap space, configure JVM -Xmx limits, and identify memory leaks.
Java Maven Dependency Error: Could Not Resolve Dependencies
Fix Maven artifact resolution failures, corrupted local repository caches, and repository authentication errors.
React map is not a function
Fix TypeError: data.map is not a function in React when rendering lists from API responses.
React Cannot Read Properties of Undefined
Fix TypeError: Cannot read properties of undefined (reading 'xyz') using optional chaining, nullish coalescing, and defensive checks.
React Module Not Found Error
Fix 'Module not found: Can't resolve...' caused by incorrect relative file paths, missing extensions, or case-sensitivity.
React Hydration Error: Text Content Does Not Match
Fix 'Hydration failed because the initial UI does not match what was rendered on the server' in SSR React.
React useEffect Infinite Loop
Diagnose and prevent infinite re-render loops caused by missing or mutating dependencies in useEffect.
Next.js Hydration Error in App Router
Fix hydration failed and server/client mismatch errors specific to Next.js Server Components and Client Components.
Next.js Module Not Found: Can't resolve in app directory
Resolve Next.js module resolution issues, broken tsconfig paths, and relative import failures in App Router.
Next.js Environment Variable Not Working
Fix undefined process.env variables in client-side Next.js components by properly prefixing with NEXT_PUBLIC_.
Angular Cannot Find Module
Fix error TS2307: Cannot find module '...' or its corresponding type declarations in Angular.
Angular ExpressionChangedAfterItHasBeenCheckedError
Resolve NG0100: Expression has changed after it was checked in Angular change detection lifecycle.
Angular NullInjectorError: No provider for Service
Fix NullInjectorError: R3InjectorError(AppModule)[MyService -> MyService] by providing services properly.
Angular CORS Error on API Requests
Solve 'Access to XMLHttpRequest has been blocked by CORS policy' in Angular using proxy.conf.json.
Angular npm install Error: ERESOLVE unable to resolve dependency tree
Fix peer dependency version mismatches when installing Angular packages with npm.
Node.js Port Already in Use (Error: listen EADDRINUSE)
Fix Error: listen EADDRINUSE: address already in use :::3000 in Node.js and Express servers.
Node.js Cannot Find Module (Error: MODULE_NOT_FOUND)
Troubleshoot Error: Cannot find module '...' in Node.js applications and ES modules.
npm EACCES Permission Error
Fix npm ERR! code EACCES: permission denied when installing packages globally or modifying directories.
npm Dependency Conflict: ERESOLVE unable to resolve dependency tree
Troubleshoot npm peer dependency conflicts, conflicting version constraints, and package-lock issues.
Express CORS Error: No Access-Control-Allow-Origin
Fix 'No 'Access-Control-Allow-Origin' header is present on the requested resource' in Express.js backends.
Python ModuleNotFoundError: No module named 'xyz'
Fix ModuleNotFoundError: No module named in Python virtual environments and scripts.
Python ImportError: cannot import name 'xyz' from partially initialized module
Solve circular imports and circular dependencies in Python packages and modules.
Python IndentationError: unexpected indent
Fix IndentationError and TabError: inconsistent use of tabs and spaces in Python scripts.
Python KeyError in Dictionary Access
Handle KeyError exceptions safely using dict.get(), setdefault(), or collections.defaultdict.
Python TypeError: object is not subscriptable
Fix 'TypeError: 'NoneType' object is not subscriptable' and argument type errors in Python.
FastAPI 422 Unprocessable Entity
Understand and fix HTTP 422 validation errors generated by Pydantic request body validations in FastAPI.
Docker Port Already Allocated
Fix 'Error response from daemon: driver failed programming external connectivity on endpoint: Bind for 0.0.0.0:xxxx failed: port is already allocated'.
Docker Container Exited (Code 0 or 137)
Diagnose why Docker containers exit immediately after starting, covering foreground commands and OOM kills.
Docker Image Not Found Error
Fix 'Error response from daemon: pull access denied for xyz, repository does not exist or may require docker login'.
Docker Permission Denied: connect to docker daemon socket
Fix 'Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock'.
Docker Build Failed: Exit Code 1
Troubleshoot failed docker build steps, caching mistakes, and package manager failures inside Dockerfiles.
Docker Compose Service Not Starting
Fix container restart loops, dependency order race conditions, and network isolation in docker-compose.
Kubernetes CrashLoopBackOff
Fix Pod CrashLoopBackOff errors caused by application exceptions, failed liveness probes, or OOMKilled events.
Kubernetes ImagePullBackOff and ErrImagePull
Troubleshoot ImagePullBackOff caused by invalid image tags, authentication secrets, or network timeouts.
Kubernetes Pod Pending: 0/N nodes available
Resolve Pods stuck in Pending state due to insufficient CPU/memory, taints, or persistent volume binds.
Kubernetes Service Not Accessible (Connection Refused or Timeout)
Debug Kubernetes Service routing issues, mismatched selector labels, and targetPort configurations.
Kubernetes ConfigMap Not Found
Fix CreateContainerConfigError and Pod pending caused by missing or misspelled ConfigMaps.
Git Merge Conflict: Automatic merge failed; fix conflicts and then commit
Understand, resolve, and prevent Git merge conflicts using visual markers, merge tools, and clean branch workflows.
Git Push Rejected (non-fast-forward)
Fix 'error: failed to push some refs to... Updates were rejected because the tip of your current branch is behind'.
Git Detached HEAD State: You are in 'detached HEAD' state
Understand what detached HEAD means in Git, how to save your work, and how to safely return to a branch.
SQL Unknown Column Error: Unknown column 'xyz' in 'field list'
Fix Unknown column in field list or column does not exist errors in MySQL, PostgreSQL, and ORMs.
SQL Syntax Error: You have an error in your SQL syntax
Diagnose and fix SQL syntax errors, reserved keyword clashes, unescaped strings, and misplaced commas.
CORS Policy Error: No Access-Control-Allow-Origin
Fix CORS preflight blocked errors, missing Access-Control-Allow-Origin, and credentials mode conflicts in fetch and axios.
REST API 401 Unauthorized Error
Fix HTTP 401 Unauthorized errors in JWT, Bearer token authentication, and expired session headers.