Closed nagarajpandith closed 1 year ago
fix this by using getStaticPaths to tell Next.js which and all usernames are available and must be made a valid route and getServerSideProps to fetch user data and return profile data back to main function component
I think that's not why it is showing 404 page, its because of
The loading is already checked here https://github.com/FiniteLoop-NMAMIT/flc-website/blob/c5a62a01d994b7e4069049ccf59af60f52ad4da5/src/components/profile/index.tsx#L237-L240
But you after that you check if data is not there then display 404 page but this happens when loading as data is still yet to come https://github.com/FiniteLoop-NMAMIT/flc-website/blob/c5a62a01d994b7e4069049ccf59af60f52ad4da5/src/components/profile/index.tsx#L263
Please correct me if I'm wrong🤲
oh, i didn't observe the
getStaticPaths
to tell Next.js which and all usernames are available and must be made a valid route andgetServerSideProps
to fetch user data and return profile data back to main function component