Common Issues
Running into problems? You’re not alone. Here are the most common issues and how to fix them.Node.js version issues
Node.js version issues
Problem: Error like “The engine ‘node’ is incompatible with this module”Solution:This playground requires Node.js 18 or higher. Check your version:If you see anything lower than
v18.0.0, you need to update Node.js:- Visit nodejs.org
- Download the LTS (Long Term Support) version
- Install it
- Restart your terminal
- Verify with
node --versionagain
npm install fails or hangs
npm install fails or hangs
Problem: 2. Delete node_modules and package-lock.json:3. Try yarn instead:4. Check your internet connection:
npm install takes forever, fails, or shows errorsSolutions to try:1. Clear npm cache:- npm needs to download packages from the internet
- Corporate firewalls can sometimes block npm
- Try using your phone’s hotspot if you suspect network issues
Port 3000 already in use
Port 3000 already in use
Problem: Error: “Port 3000 is already in use”What’s happening: Another app is already running on port 3000Solution 1 - Find and kill the process:On Mac/Linux:On Windows:Solution 2 - Use a different port:Then open http://localhost:3001
Hot reload not working
Hot reload not working
Problem: Changes to code don’t show up in the browser automaticallySolutions:1. Hard refresh the browser:4. Clear Next.js cache:5. Disable browser extensions:
- Mac:
Cmd + Shift + R - Windows/Linux:
Ctrl + Shift + R
- Press
Ctrl + Cin the terminal to stop it - Run
npm run devagain
- Some ad blockers or extensions can interfere
- Try opening in incognito/private mode
Module not found errors
Module not found errors
Problem: Error like “Cannot find module ‘react’” or similarSolutions:1. Install dependencies:2. Check you’re in the right directory:Make sure you’re inside a lesson folder (like 4. Check for typos in imports:
01-hello-saas), not the root.3. Reinstall everything:Tailwind CSS styles not working
Tailwind CSS styles not working
Problem: Tailwind classes aren’t applying stylesSolutions:1. Check tailwind.config.js:Make sure content paths are correct:2. Import Tailwind in globals.css:3. Restart dev server:4. Check for typos in class names:
'use client' errors
'use client' errors
Problem: Error about using hooks or events in Server ComponentsWhat’s happening: You’re trying to use client-side features (like When you need ‘use client’:
useState, onClick) in a Server ComponentSolution: Add 'use client' at the top of the file:- Using React hooks (
useState,useEffect, etc.) - Adding event handlers (
onClick,onChange, etc.) - Using browser APIs (
window,localStorage, etc.) - Using client-side libraries
Database connection issues
Database connection issues
Problem: Can’t connect to MongoDB or database errorsSolutions:1. Check your .env.local file:Make sure it exists and has the correct MongoDB URI:2. Verify MongoDB credentials:Environment variables are loaded at startup.
- Check username and password are correct
- No special characters that need URL encoding
- Database name is correct
- Go to Network Access
- Add your current IP address
- Or add
0.0.0.0/0to allow all (development only!)
Stripe integration issues
Stripe integration issues
Problem: Stripe checkout or webhooks not workingSolutions:1. Check environment variables:Make sure these are in 2. Use Stripe test mode:Make sure you’re using test keys (they start with 4. Check webhook endpoint:Make sure your webhook route is configured correctly in
.env.local:pk_test_ and sk_test_), not live keys.3. Test webhook locally:Use Stripe CLI to forward webhooks:app/api/webhook/route.jsDeployment issues (Vercel)
Deployment issues (Vercel)
Problem: App works locally but fails on VercelSolutions:1. Check environment variables:Make sure all 4. Clear Vercel cache:In your deployment settings, try “Redeploy” and check “Clear cache”.
.env.local variables are added in Vercel dashboard:- Go to Project Settings
- Click Environment Variables
- Add each variable
- Missing dependencies
- Type errors
- Environment variable issues
package.json, specify the Node version:ESLint or TypeScript errors
ESLint or TypeScript errors
Problem: Code works but shows errors in editorSolutions:1. Install dependencies:2. Restart your editor:VS Code and other editors sometimes need a restart to pick up changes.3. Disable for a line (if needed):But try to fix the actual issue first!
Still Stuck?
If none of these solutions work:- Copy the exact error message and search Google
- Check Stack Overflow - search for your error
- Ask AI tools (ChatGPT, Claude) - paste your error and code
- Join the community - other learners might have solved it
- Check GitHub issues - see if it’s a known issue
When asking for help, always include:
- The exact error message
- What you were trying to do
- What you’ve already tried
- Your Node.js version (
node --version)
Prevention Tips
Before you start coding:- Make sure you’re in the right directory
- Run
npm installfirst - Check that the dev server is running
- Open the right URL (usually http://localhost:3000)
- Save files before checking the browser
- Check the terminal for error messages
- Read error messages carefully - they’re helpful!
- Test small changes frequently
- Don’t panic - errors are normal
- Read the error message
- Check what you changed last
- Use git to revert if needed