route not working
Answered
CHEEMDA MAN posted this in #help-forum
i'm using this folder struture shown in image but in browser it is showing 404
This page could not be found.
This page could not be found.
16 Replies
Sun bear
Do you use app router? In case yes then it should be
page.jsxAnswer
@Sun bear Do you use app router? In case yes then it should be `page.jsx`
ah.. okay so we can't put dynamic name to a file
@CHEEMDA MAN ah.. okay so we can't put dynamic name to a file
Sun bear
Exactly. Only folders can be dynamic
@Sun bear Exactly. Only folders can be dynamic
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
Sun bear
@CHEEMDA MAN 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
Sun bear
Can you show the code of page jsx and the directory where it is
@CHEEMDA MAN yea here it is
Sun bear
Try
params.itinerarytype so the name of the dynamic folders@Sun bear Try `params.itinerarytype` so the name of the dynamic folders
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
@CHEEMDA MAN ah can you give refference regrading fetch and find data from api in page.jsx without making it client side
Sun bear
Sure:
https://nextjs.org/docs/app/building-your-application/data-fetching/fetching
Just make the page function async and fetch it
https://nextjs.org/docs/app/building-your-application/data-fetching/fetching
Just make the page function async and fetch it