What's the difference between a 500 error and a 404 error in Next.js App Router?

Question

Grade: Education Subject: Support
What's the difference between a 500 error and a 404 error in Next.js App Router?
Asked by:
80 Viewed 80 Answers

Answer (80)

Best Answer
(327)
A 500 error (Internal Server Error) indicates a problem on the server-side, such as an unhandled exception or a database error. A 404 error (Not Found) means the requested resource doesn't exist. The App Router handles 404s with `not-found.js`, while 500s require proper error handling within your route handlers or components.