-
Notifications
You must be signed in to change notification settings - Fork 27.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not-found.js
does not work within a route group
#51075
Comments
Related: #50034 |
I confirm this does not work and created a Stackblitz Reproduction and found this issue. |
Running into this same issue now. I think that's on purpose though, the docs state that only the root Edit: I think it could be because it doesn't match a part of the URL, it either matches it completely or not at all. Some clarification on all of this from the Next team would be great though. |
I'm running into this issue too. The problem is related to the use of next-intl, to get all pages (including app/page.tsx) localized properly, we have to put everything under app/(locales) route group. And then not-found.tsx itself became NOT FOUND. Any workround or fixing suggestions are welcome. |
The solution mentioned in #50034 (i.e. adding a [...not-found] route) worked. Saved my day. |
For group routes, as their custom layout show up at the 1st level of the loader tree, so previously we tried to add the default not-found to that layer, but if they have custom root not-found, we should use that as the root not-found componeny, instead of using default not-found component to form the 404 page Closes NEXT-1588 Fixes #51075 Fixes #54892
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023 Binaries: Node: 16.17.0 npm: 8.15.0 Yarn: 1.22.19 pnpm: 7.1.0 Relevant packages: next: 13.4.5-canary.9 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 4.9.5
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/youthful-zhukovsky-qpjl36
To Reproduce
not-found.js
inside the group.Describe the Bug
not-found.js
file isn't working within a route group.Expected Behavior
Reading the documentation I saw that it has no limitation for route group.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: