notFound()
thrown in dynamic segment shows "pages" 404 while app/not-found.tsx
is present
#54174
Closed
1 task done
Labels
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 Binaries: Node: 18.16.1 npm: 9.5.1 Yarn: N/A pnpm: 8.3.1 Relevant Packages: next: 13.4.17 eslint-config-next: 13.4.17 react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.6 Next.js Config: output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router, Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/MKraust/next-404-segment-bug
To Reproduce
npm run build && npm run start
/dynamic/404
app/dynamic/layout.tsx
instead ofapp/not-found.tsx
/foo/bar
app/not-found.tsx
is rendered correctly/dynamic-with-not-found/404
app/dynamic-with-not-found/[slug]/not-found.tsx
is rendered correctly (same if moveapp/dynamic-with-not-found/[slug]/not-found.tsx
toapp/dynamic-with-not-found/not-found.tsx
)Describe the Bug
notFound()
thrown in dynamic segment shows "pages" 404 while rootapp/not-found.tsx
is present.Expected Behavior
I expect that
notFound()
thrown anywhere would propagate to the first matchingnot-found.tsx
in theapp/
hierarchy.In case of
/dynamic/404
it's rootapp/not-found.tsx
. It's working properly onnext@13.4.12
That behavior is described here. Specifically, the words:
Which browser are you using? (if relevant)
115.0.5790.170 (arm64)
How are you deploying your application? (if relevant)
next start
The text was updated successfully, but these errors were encountered: