Next.js optional catch all routes support

I’m currently getting an error when trying to use Next.js - Optional catch all routes in my Next.js application.

Example Next.js Route: /pages/post/[[...slug]].js
Example Error: XDN error - Route pattern "/_next/data/:build/post/::slug*.json" contains invalid syntax.

Are optional catch all routes not currently supported by nextRoutes/xdn?

Note: catch all routes work fine, e.g. /pages/post/[...slug].js. Is there an intended workaround or do I need to duplicate the route/page within both /pages/post.js and /pages/post/[...slug].js instead?

It’s not yet supported, but we can release a patch to accommodate this in the next few days. We will post here when it’s available. Stay tuned.

1 Like

Tracked internally as XDN-9941

Support for optional catch-all routes (e.g /blog/[[slug]].js) was released today in @xdn/next v2.48.0.

I’ll check it out now, thanks Mark!

your information is very interesting and good question but i am not idea.