最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

localization - 404 Page not Displaying in Localized Next.js 14 App - Stack Overflow

programmeradmin1浏览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)

  1. 暂无评论