Next.js Discord

Discord Forum

Page is not detected

Answered
Spectacled Caiman posted this in #help-forum
Open in Discord
Spectacled CaimanOP
Hello everyone, I'm new to Next.js and trying to follow the tutorial.

Now I'm trying to create a new page.

Directory Structure
app
  group
    page.tsx
  page.tsx


app/group/page.tsx
export default function Page() {
    return (
        <div>This is group page.</div>
    )
}


But, it return 404 when I'm accessing /group
Answered by joulev
Add default.tsx to each of the parallel route slots
View full answer

11 Replies

Sun bear
Looks good to me. Is the homepage working?
Spectacled CaimanOP
Yes, the homepage is working
@Spectacled Caiman Click to see attachment
Add default.tsx to each of the parallel route slots
Answer
Spectacled CaimanOP
It's working, but I don't understand
Why it can't render the parallel route slots?
@Spectacled Caiman Why it can't render the parallel route slots?
@team/page.tsx is only for /. If you want to get a parallel route slot for /group, you need @team/group/page.tsx.

If nextjs doesn’t find a page file for a parallel route slot, it tries to render a default.tsx file if it exists. If no such files exist, 404 is thrown.

Reference: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs
Spectacled CaimanOP
ahaa, thank you so much!