0

I wrote not-found.tsx on top of the default file created when create next app. It seems to be working fine, but the console keeps giving me an error every second.

Also, when I run the next app with next dev --turbo, a huge error occurs when accessing localhost:3000/404.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

I am now new to next.js. And I am learning App Router. The question that comes to mind while learning is whether this can be applied to a product. I feel like Next.js is too shabby, and as someone who developed only React as a SPA for 4 years, it's very confusing.

1 Answer 1

0

I ended up adding a catch-all route where the 404 was being generated from to return notFound() from it.

Create a folder: e.g. [...404] Create a page.tsx or page.jsx page with the following:

import { notFound } from "next/navigation"
export default function NotFound() {
  return notFound()
}

Full article https://github.com/vercel/next.js/discussions/40000

Sign up to request clarification or add additional context in comments.

1 Comment

I'm really sorry, but none of the answers in the link github.com/vercel/next.js/discussions/40000 work properly in Next13.4.19 on Turbopack

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.