Next.js Discord

Discord Forum

Dynamic routing in Next.js 14

Unanswered
Bengal posted this in #help-forum
Open in Discord
BengalOP
I am using Next.js 14. I am not sure what is exactly wrong with my code. this is a "page.js" at "app/profile/[user_id]" so it is supposed to be a dynamic route, and based on the [user_id] it would be used in fetching data then show data if it's available.

17 Replies

no arg in this function
you passing it here but the function itself not accepting arg
BengalOP
good catch, thanks
but it still gives me the same error
i think it's not related to that
there is an error too
but i can't see it
and you shouldn't import getServerSideProps from there
Satin Angora
This might be a long shot but try removing your node modules and your lock file and installing everything again
Also I think it seems like you're using path aliases make sure thats properly configured
@/


this specifically
@Ray there is an error too
BengalOP
it's just a random error i see everywhere
I'm sure there is nothing wrong with this import because it all works well with no async Page and fetching
when i remove async from Page() I get this:
BengalOP
so apparently i would need to use something similar to generateStaticParams:
you dont put that in page.