Comments (3)
i think
not-found
pages are only shown when thenotFound()
function is thrown. see next.js docs.to display the nested
[locale]/not-found
page, you can add a catch-all route segment at[locale]/[...404]/page.tsx
which callsnotFound()
. this is what e.g.next-intl
recommends - see their docs for an example.
The linked doc also say it catches all the unmatched urls with this not-found.jsx;
And it does that well in our project without the [lang] folder. Only when we add the [lang] folder does this issue happen.
Will try out this catch-all route segment approach but this issue needs to be resolved on the root cause itself.
from next.js.
i think not-found
pages are only shown when the notFound()
function is thrown. see next.js docs.
to display the nested [locale]/not-found
page, you can add a catch-all route segment at [locale]/[...404]/page.tsx
which calls notFound()
. this is what e.g. next-intl
recommends - see their docs for an example.
from next.js.
@pranavks, used like this example
.
└── src/
├── app
└── [...not_found]/
├── page.tsx
└── layout.tsx
from next.js.
Related Issues (20)
- Triggering notFound in generateMetadata results in Unhandled Runtime Error Error: NEXT_NOT_FOUND HOT 1
- File name too long (os error 63) since > 14.2 HOT 2
- Docs: Pages and layouts section not opening HOT 6
- Page won't rerender when initial searchparam is removed HOT 3
- Typescript type for router.query is incorrect since it can be undefined (on first render in frontend) HOT 1
- Typescript type for router.query is incorrect since it can be undefined (on first render in frontend) HOT 1
- Routes are broken when the page extension contains only 'tsx'. HOT 4
- Docs: Allow https://nextjs.org/ to work when PerformanceObserver is undefined
- v14.2.x gives warning for `Invalid page configuration` for `middleware.ts` HOT 3
- Dependencies with `exports` field break on pages router with `esmExternals: false` HOT 1
- Intercepted page in dynamic route with route groups gets called when linked from another segment
- Rewritten paths cause a client side redirect unexpectedly when set up with basePath: false and an active basePath
- SWC does not catch nested `styled-jsx` tags in props HOT 2
- SWC panicks when processing nested `styled-jsx` tags HOT 2
- Code with a worker fails to build under the edge runtime, even if it's dead code.
- Runtime error in my local machine in rendering current time HOT 4
- Cdn problem with App Router HOT 1
- Values sent by headers in the middleware are not accepting letters with accents HOT 2
- Docker image ignores signals HOT 1
- Browser Navigation does not load correct page HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next.js.