Next.js: file system-based dynamic routes - slug and param and string combination

Created on 5 Aug 2019  路  3Comments  路  Source: vercel/next.js

Feature request

Is your feature request related to a problem? Please describe.

A clear and concise description of what you want and what your use case is.

Currently with nextjs9 we can make routes like

root/city/[id].js  
root/city/[id]/details.js

this cool.

Describe the solution you'd like

But we can't make routes like:

root/city-[id]/details.js

Describe alternatives you've considered

Additional context

Add any other context or screenshots about the feature request here.

Most helpful comment

@Timer #7607 seems related but there is more :
Next.js9 use path-to-regexp) for routing and i just wondering why in nextjs we cant build folder slugs like :

/ads/[art-:id]/details/[location]
/ads/[auto-:id]/details/[location]
/ads/[home-:id]//details/[location]

this will cause a error :

throw new Error('You cannot use different slug names
for the same dynamic path.');

but we can use same patterns in express.js with path-to-regexp ,

All 3 comments

@Timer #7607 seems related but there is more :
Next.js9 use path-to-regexp) for routing and i just wondering why in nextjs we cant build folder slugs like :

/ads/[art-:id]/details/[location]
/ads/[auto-:id]/details/[location]
/ads/[home-:id]//details/[location]

this will cause a error :

throw new Error('You cannot use different slug names
for the same dynamic path.');

but we can use same patterns in express.js with path-to-regexp ,

Duplicate of #9081

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

renatorib picture renatorib  路  3Comments

havefive picture havefive  路  3Comments

sospedra picture sospedra  路  3Comments

swrdfish picture swrdfish  路  3Comments