Next nested route not working on netlify
Answered
Sirex woodwasp posted this in #help-forum
Sirex woodwaspOP
import Link from "next/link";
...
<Link href={"/market/gempack"}>
...
on localhost, it's working well when i click the link, it smoothly redirects to the prefetched route but on netlify deployment, not working at all, just showing 404 page after i clicked the link and seems it was hard refreshing the page when clicked
The page is located in /src/market/gempack/index.tsx
Any helps would be appreciated here
...
<Link href={"/market/gempack"}>
...
on localhost, it's working well when i click the link, it smoothly redirects to the prefetched route but on netlify deployment, not working at all, just showing 404 page after i clicked the link and seems it was hard refreshing the page when clicked
The page is located in /src/market/gempack/index.tsx
Any helps would be appreciated here
Answered by Persian
create "gempack.tsx' file in /src/market folder instead of the index.tsx file
30 Replies
Sirex woodwaspOP
bump
any netlify errors?
or console
Sirex woodwaspOP
no errors, just it's not going to the expected page, but shows 404
Sirex woodwaspOP
bump
Persian
bump
have you ever tried to host the website on vercel or other service?
Sirex woodwaspOP
didn't have a chance to do that but really curious why it's not working on netlify
Persian
it wont take so much time. if it works on other platforms, netlify should be a main problem
Sirex woodwaspOP
okay mate, i will try another one
Persian
i have used netlify service and imo its not a good option for you
lmk if it works or not anyway
Sirex woodwaspOP
alright man
Persian
or, did you try to change the Link url to absolute url?
Sirex woodwaspOP
can you give me an example?
Persian
like this - https://terlgfortune.jjg/market/gempack
anyway i am sure that your code will work correctly on vercel
Sirex woodwaspOP
i c, no worries man, am trying to build on vercel
will let you know shortly if it works
Persian
okay
Sirex woodwaspOP
unfortunately, not working as well on vercel.. 😦
Persian
hmm...
can you share the screenshot?
Persian
create "gempack.tsx' file in /src/market folder instead of the index.tsx file
Answer
Sirex woodwaspOP
hmm.. okay, will try
should take a few mins to fix and deploy, will let you know if it works
i don't know how it does but anyway it worked!
Persian
sounds good
Sirex woodwaspOP
thanks my man 😄
Persian
sure