-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Docs: parallel routes must provide a default.js
file or else it will throw a 404 error
#48090
Comments
I ran into this problem as well. It also seems like, to get the page to load on hard refresh, I needed to add a I literally just added this to make it work. import Page, { PageProps } from './page'
export default async function Default(props: PageProps) {
return (
// @ts-expect-error Async Component
<Page {...props} />
)
} Seems like that should be the generic default when unspecified, IMO. |
Wow, nice catch, it is also very unintuitive for me why we need all these |
it's not work in complex case like more than one level or Catch-all Segments, it seems
If this is how it's designed, it's not a good pattern
|
FYI this does not seem to work when you use the route group hack and refresh the page edit: Nevermind, this has been fixed, the route group hack isn't anymore 👍 |
Looks like some docs were added on this here! |
thank you @ztanner i am closing this issue |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What is the improvement or update you wish to see?
When using parallel routes, if someone provide a child under the parent route, when navigating to the child route, next will show a 404 page instead of the page, i have noticed that adding a
default.js
fixes this.I think this should be added to the docs.
It must also be noted that it parent
layout.js
does not render the{user}
prop inside the JSX, navigating todashboard/child-route
will work normally, but the@user
parallel page will not be shown when navigating to/dashboard
.This should be highlighted in the docs as users could easily stumble on this error.
Is there any context that might help us understand?
N/A
Does the docs page already exist? Please link to it.
https://beta.nextjs.org/docs/routing/parallel-routes#defaultjs
The text was updated successfully, but these errors were encountered: