I'm using the default dynamic routing technique of nextjs in my project which is based on the folder structure. I have a route which is:
pages/[language]/location/[location_id]
Now I'm coming across a use case where I need the above route exactly the same except the last parameter of [location_id]
, I need [route_id]
here.
When I created a file [route_id].js
for this new route, I'm facing this error:
throw new Error(`You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`);
I'm aware of the error and the problem about why it's showing me this after doing some research but I'm unable to understand how I can solve this problem. I just want a solution how I can implement these two routes in my app:
Route 1: pages/[language]/location/[location_id]
Route 2: pages/[language]/location/[route_id]
PS: I've already studied this: https://github.com/zeit/next.js/issues/9081
route_id
for the new route. – Kirschner