While I am trying to create dynamic routing for route pattern
/category1?/category2?/category3?/category4?/c/categoryId
Here category1 to category4 are optional in route but after that /c/categoryId
is fix.
In order to solution I had tried optional catch-all-segments
- [[...category]]
------- c
-----------[categoryId]
---------------- page.tsx
But getting error that
[Error: Invalid segment Dynamic("categoryId"), catch all segment must be the last segment (segments: [OptionalCatchAll("category")])
Looks like fix slug cant be place after a optional route segment.
Is there any way to fix achieve this URL pattern where optional slags can be placed before fix slug part.
Thanks in advance for your time and knowledge sharing.