Dynamic path multiple levels error:Error: You cannot use different slug names for the same dynamic p
Answered
House Sparrow posted this in #help-forum
House SparrowOP
Hello, I'm trying to set a custom path with two dynamic subfolder:
root.com/[teamName]/[projectId]/survey
I'm getting the error: Error: You cannot use different slug names for the same dynamic path ('teamName' !== 'uid')
How to fix it?
thanks!
root.com/[teamName]/[projectId]/survey
I'm getting the error: Error: You cannot use different slug names for the same dynamic path ('teamName' !== 'uid')
How to fix it?
thanks!
Answered by joulev
Yes that works. Though you may want to edit the “uid” name for your future self to know that it could mean teamName too
8 Replies
@House Sparrow Hello, I'm trying to set a custom path with two dynamic subfolder:
root.com/[teamName]/[projectId]/survey
I'm getting the error: Error: You cannot use different slug names for the same dynamic path ('teamName' !== 'uid')
How to fix it?
thanks!
You can’t have
/[teamName]/…
and
/[uid]/…
at the same time
/[teamName]/…
and
/[uid]/…
at the same time
Need to unify those segments
House SparrowOP
Seems like it.. It's my [uid] folder that break it right?
Yup
When nextjs receives a request, say, /helloworld, it doesn’t know whether to route it to [uid] or [teamName]
House SparrowOP
How could I get to the same result here then?
So if I move the folder teamName/spaceId/survey in uid,
[uid] > [spaceId] > Survey > page.tsx would work?
So if I move the folder teamName/spaceId/survey in uid,
[uid] > [spaceId] > Survey > page.tsx would work?
@House Sparrow How could I get to the same result here then?
So if I move the folder teamName/spaceId/survey in uid,
[uid] > [spaceId] > Survey > page.tsx would work?
Yes that works. Though you may want to edit the “uid” name for your future self to know that it could mean teamName too
Answer
House SparrowOP
Excellent, thanks for the quick help !!