0

I have a localized Next.js 14 app. I followed the setup described in the Nextjs i18n docs, and I have my root layout within an /app/[lang] directory. When I add a 404 page to this directory (/app/[lang]/not-found.tsx), it is not displaying this page on invalid routes. I still get the default 404 page. When I try placing the not-found.tsx file directly within the app folder (/app/not-found.tsx), I get the following error: "not-found.tsx doesn't have a root layout. To fix this error, make sure every page has a root layout." Of course, I want to keep my root layout within the [lang] folder to keep the app localized.

0

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.