-
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.tsx
within the route segment does not catch notFound()
#53344
Comments
related #48763 |
experiencing the same problem after upgrading - had to downgrade it back to 13.4.9. Glad we had e2e tests to test 404 pages and it failed. |
See #48763 (comment) More specifically
So in your case, |
@balazsorban44 not any level of higher up, only root will catch it automatically. |
Actually, on second look, it seems like a different issue, will track and investigate further! |
### What & Why The dynamic not-found boundary didn't work as expected as it was using the `pathname` to match how many levels of the segements should be matched. For dynamic routes this doesn't work, unlike normal page, the unmatched segment can also hit the not found boundary in the same level. ### How Use `segment` of loader tree nodes to determine if not-found boundary searching is reached to the end instead of using `pathname`. > NOTE: For production `/_not-found` case since it's a valid page on production and still has the original tree, so we handle that as a special case to use the not found loader tree (with empty child routes) to render. Fixes #53344
As of 13.4.16 (same for 13.4.17) dynamic segment is catching it's Let's image this kind of
It seems like |
@MKraust mind creating a new issue with a reproduction for that? Thanks 🙏 |
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: 18.14.2 npm: 9.5.0 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 13.4.13-canary.6 eslint-config-next: 13.4.12 react: 18.2.0 react-dom: 18.2.0 typescript: 5.0.4 Next.js Config: output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/kind-star-ztsjqt
To Reproduce
Create a
not-found.tsx
file inside a route segment. CallnotFound()
inside the correspondingpage.tsx
.Describe the Bug
On versions greater than
13.4.9
, anot-found.tsx
does not catch theNEXT_NOT_FOUND
error when thrown by the correspondingpage.tsx
and (most likely) pages further down the tree.Expected Behavior
The expected behavior is that the closest
not-found.tsx
is rendered whenNEXT_NOT_FOUND
is thrown.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1490
The text was updated successfully, but these errors were encountered: