Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not found page error #424

Open
foadabdollahi opened this issue Sep 4, 2024 · 0 comments
Open

Not found page error #424

foadabdollahi opened this issue Sep 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@foadabdollahi
Copy link

I have a page and for some reason want show 404 error page with 404 httpstatus .
my page:


//app/[locale]/blog/[id]/page.tsx

import { notFound } from 'next/navigation'
import React from 'react'

export default function Page() {
   //some if or when fetch server was null
    return notFound()
  
  return (
        <div>page xxx</div>
    )
}

But with this code i got
NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

And when i add not-found.ts in [locale] folder the error was gone and not-found.ts will show. but it has 200OK HTTP status instance of 404 HTTP status code.

@foadabdollahi foadabdollahi added the bug Something isn't working label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant