---
title: "Discussion on \"How to Resolve NextJS Not Returning Correct Status for 404 Pages\" | Hashnode"
description: "Discussion on \"How to Resolve NextJS Not Returning Correct Status for 404 Pages\". I was struggling to understand why my NextJS project using app router was not returning a 404 status code when I used the built in notFound() function. This took to me some time to figure out, so I am sharing the fix here in hopes that it will help s..."
url: "https://hashnode.com/posts/how-to-resolve-nextjs-not-returning-correct-status-for-404-pages/68ac7f253be184244613aaef"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Resolve NextJS Not Returning Correct Status for 404 Pages](https://chjweb.se/blog/how-to-resolve-nextjs-not-returning-correct-status-for-404-pages?utm_source=hashnode&utm_medium=feed)

I was struggling to understand why my NextJS project using app router was not returning a 404 status code when I used the built in notFound() function. This took to me some time to figure out, so I am sharing the fix here in hopes that it will help s...

Aug 25, 2025 · 2 min read · chjweb.se  
Read the article

-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Carl Hallén Jansson](https://hashnode.com/@chjweb)

@chjweb · Sweden

  
[View profile](https://hashnode.com/@chjweb)

Frontend developer and freelancer

I am a freelancing web developer from Sweden with a passion for JAMstack and serverless.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
