You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Customized 404 not applied for docs/ sub routes #9665
It seems that swizzled 404 are resolved when a root URL is accessed but, not when a sub-route is loaded.
e.g.
http://localhost:3000/unknown -> custom 404 http://localhost:3000/docs/unknown -> default 404 (or custom 404 for a milli seconds and default afterwards)
This was added to fix double layout issue for 404 in docs - ca177b3
Maybe we have to update swizzle plugin to emit or wrap NotFoundContent component instead of NotFound. Instead of this docusaurus swizzle "@docusaurus/theme-classic" "NotFound" it should be changed to docusaurus swizzle "@docusaurus/theme-classic" "NotFoundContent".
Or else we have to move the content from NotFound.js to NotFoundContent.js, that should fix this issue and somehow make sure this is documented.
Activity
murali-krishna-sv commentedon Dec 29, 2023
Looks like only for the docs route, the 404 content comes from NotFoundContent. As the DocRoot 404 is having this - https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-theme-classic/src/theme/DocRoot/index.tsx#L24
This was added to fix double layout issue for 404 in docs - ca177b3
Maybe we have to update swizzle plugin to emit or wrap
NotFoundContentcomponent instead ofNotFound. Instead of thisdocusaurus swizzle "@docusaurus/theme-classic" "NotFound"it should be changed todocusaurus swizzle "@docusaurus/theme-classic" "NotFoundContent".Or else we have to move the content from NotFound.js to NotFoundContent.js, that should fix this issue and somehow make sure this is documented.
[-]404 not working on sub routes[/-]