Next.js Discord

Discord Forum

404 on server side while loading on client (app directory)

Answered
English Toy Terrier posted this in #help-forum
Open in Discord
English Toy TerrierOP
I use the app directory method and I have a folder with a page.ts inside.

The page load when coming from a client transition with Link. But if I try to access directly the page or I refresh it I get a 404.

Here is the repository: https://github.com/clempat/profilePal

Thanks for the help
Answered by Ray
you should use default.tsx instead of page.tsx for @header
View full answer

36 Replies

English Toy TerrierOP
I really don't understand. I even see it when building the application:
@English Toy Terrier I really don't understand. I even see it when building the application:
I just cloned your repo and it work for me
but I had to install @storybook/addon-actions to make it build
English Toy TerrierOP
Ok so it sounds like some cache things
oh oups I missed a --save
oh nm, you not using it
English Toy TerrierOP
English Toy TerrierOP
Ah you see
I can access it through the client
but not the server
This is super weird
I wonder if it has something to do with the standalone option
Ah no, I deleted it because I asumed it could be the issue 😄
This is interesting:
can you try comment out header in layout.tsx and see if it works
look like it works for me
English Toy TerrierOP
Oh it does
lol
English Toy TerrierOP
Interesting, why
look like a bug here, but i never had this issue
English Toy TerrierOP
Ok I will open an issue on the github. Thanks for your time
np
maybe the name? can using different name instead of header
English Toy TerrierOP
I try myheader and get the same issue
oh
English Toy TerrierOP
I guess it concerns only content which are rendered as static. Because the homepage works
ah I think i know
yes it works
you should use default.tsx instead of page.tsx for @header
Answer
English Toy TerrierOP
Oh my god, You are awesome
You saved me extra hours looking into this
I did not see that in the documentation, did I miss it?
English Toy TerrierOP
Oh great THANK YOU SOOOO MUCH
please mark solutions 😀