- 404 => 404.js
- 500 => 500.js
Next.js 404 Code Example
For the 404 error codes, you can have the "404.js" page export like the following. Do note that you can customize it however you want it to be.
// pages/404.js export default function Custom404() { return <h1>404 - Page Not Found</h1> }
Next.js 500 Code Example
For 500 error codes, it's the same as 404 and you can refer the code example below.
// pages/500.js export default function Custom500() { return <h1>500 - Server-side error occurred</h1> }
Leave a reply