Skip to content

Rule · Lint

notFound()/redirect() inside a component rendered under <Suspense>

lint/not-found-in-suspensewarnvoid lintupdated

Why it matters

Once streaming starts the HTTP status is already sent. notFound() thrown inside a Suspense boundary returns 200 with a noindex meta (a soft 404), and redirect() becomes a client-side redirect crawlers may not follow.

How to fix it

Resolve existence at the top of page.tsx (or in generateMetadata) before rendering any , then pass the data down.

Example

tsx
export default async function Page({ params }) {
  const post = await getPost((await params).slug)
  if (!post) notFound()          // before any Suspense
  return <Suspense fallback={<Skeleton />}><Comments id={post.id} /></Suspense>
}

References

void lint reports 67 rules in this category. Static source checks with no browser: Tailwind v4 silent failures, Next.js 16 API traps, React render-body bugs, accessibility markup, SEO files and motion hygiene.