admin 管理员组

文章数量: 1086019

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.

本文标签: localization404 Page not Displaying in Localized Nextjs 14 AppStack Overflow