You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I have a page and for some reason want show 404 error page with 404 httpstatus .
my page:
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 has200OK HTTP status
instance of404 HTTP status code
.The text was updated successfully, but these errors were encountered: