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.
localization - 404 Page not Displaying in Localized Next.js 14 App - Stack Overflow
评论列表(0)
- 暂无评论