Catch-all must be the last part of the URL.
Unanswered
Red-throated Loon posted this in #help-forum
Red-throated LoonOP
I would like to make dynamic routes like:
But I get this error
/app
/app/[[...path]]
/app/[[...path]]/edit
/app/[[..path]]/edit/page.tsx
/app/[[...path]]/add
/app/[[..path]]/add/page.tsx
/app/[[...path]]/page.tsxBut I get this error
Error: Catch-all must be the last part of the URL. which is pretty clear, but is there any way to achieve dynamic routes like described above?4 Replies
@Red-throated Loon I would like to make dynamic routes like:
/app
/app/[[...path]]
/app/[[...path]]/edit
/app/[[..path]]/edit/page.tsx
/app/[[...path]]/add
/app/[[..path]]/add/page.tsx
/app/[[...path]]/page.tsx
But I get this error `Error: Catch-all must be the last part of the URL.` which is pretty clear, but is there any way to achieve dynamic routes like described above?
You have to handle this manually inside [[…path]]/page.tsx
Checking what the last element of the params.path array is
And handle accordingly
Red-throated LoonOP
Ah, I see, sounds good, thanks