From the course: Learning Next.js

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Handling errors with a fallback page (404 not found)

Handling errors with a fallback page (404 not found)

From the course: Learning Next.js

Handling errors with a fallback page (404 not found)

- With Next.js, we have a default 404 page. So it also comes with an advanced feature which is allowing us to customize the 404 page in order to improve the user experience, which is that when you land on a resource which you know does not exist, so we're going to give it a try. Actually, we are using right now, So this demonstration for the 404 page, let's make sure that we run this app on the local host 3000 and let's give it a try. So for now we can navigate from the homepage to the top stories. That's great, we can go to the popular stories. But let's try something that we know doesn't exist. We're going to land on this page, which is the default 404 page for every Next.js application. So instead what we can do is create our own 404 page. This is very important because without any specific page, this could result in increased costs, slower user experience, and overall, you never want your customers to leave your website…

Contents