Next.js Discord

Discord Forum

route not working

Answered
CHEEMDA MAN posted this in #help-forum
Open in Discord
Avatar
i'm using this folder struture shown in image but in browser it is showing 404
This page could not be found.
Image
Answered by Sun bear
Do you use app router? In case yes then it should be page.jsx
View full answer

16 Replies

Avatar
appearing this
Image
Image
Avatar
Sun bear
Do you use app router? In case yes then it should be page.jsx
Answer
Avatar
ah.. okay so we can't put dynamic name to a file
Avatar
Sun bear
Exactly. Only folders can be dynamic
Avatar
okay then i have to put it in 2 dynamic folder and after that when i'm trying fetch the id and title from url it shows empty
Avatar
Sun bear
Avatar
yeaa
Avatar
Sun bear
Can you show the code of page jsx and the directory where it is
Avatar
yea here it is
Image
Avatar
Sun bear
Try params.itinerarytype so the name of the dynamic folders
Avatar
got it thanks brother
issue solved
ah can you give refference regrading fetch and find data from api in page.jsx without making it client side
Avatar
Sun bear
Sure:
https://nextjs.org/docs/app/building-your-application/data-fetching/fetching

Just make the page function async and fetch it
Avatar
great