tatethurston / nextjs-routes

Type safe routing for Next.js
MIT License
557 stars 21 forks source link

Handling Catch All Routes #109

Closed JameelKhan9 closed 1 year ago

JameelKhan9 commented 1 year ago

Love the type-safe routes!

However, I am having issues using the features nextjs-routes makes available with Catch All Routes: https://nextjs.org/docs/api-routes/dynamic-api-routes#catch-all-api-routes

This comes around due to some SDKs requiring catch alls or optional catch alls: https://github.com/auth0/nextjs-auth0#add-the-dynamic-api-route

Probably not an easy one to fix, but would be really powerful to be able to handle catch-all routes.

tatethurston commented 1 year ago

Hey @JameelKhan9 catch all routes are already supported. Could you share the error you’re seeing, the version you’re using and your nextjs-routes.d.ts file?

tatethurston commented 1 year ago

@JameelKhan9 This is already supported. Feel free to reopen this with reproduction steps if you're still seeing this issue.

JameelKhan9 commented 1 year ago

@tatethurston I just had another look, and I managed to get it to work. I think the usage of catch-all routes wasn't as intuitive the first time I looked at it.

Cheers!