Next.js Discord

Discord Forum

useRouter in pages resolves dynamic id locally, but doesn't resolve it on remote

Unanswered
Ocicat posted this in #help-forum
Open in Discord
OcicatOP
So I am using the useRouter from next/router to get the route params in my component, I have a dynamic path [someId] and try to get it with
const router = useRouter();
const { someId } = router.query;


logging the id, it's logged undefined 2 times in the body of the function, but then gets resolved locally, but on remote, only those 2 undefined times are logged, but then it isn't resolved at all.

I also want to mention I renamed that dynamic path, but can it be the reason? Why then

I am currently using next 14.1.0

5 Replies

pages or app router?
@josh pages or app router?
OcicatOP
pages router, but I am using app router too. They don't work together though, nor am doing any navigation between the 2
OcicatOP
also, I now see some logs on remote regarding double slashes, but because of them I see it's trying to use the old naming for the dynamic path, lol.
Does this have a workaround?
OcicatOP
The source code has the old file structure in vercel at deployment basically instead of the newly renamed one
OcicatOP
Not a problem with nextjs or Vercel, it's messed up starting from github.