Exclude dynamic routes in Clerk middleware

I am attempting to exclude all routes for my page /test/[id].tsx

This is what my Clerk middleware looks like:
import { authMiddleware } from "@clerk/nextjs";

// This example protects all routes including api/trpc routes
// Please edit this to allow other routes to be public as needed.
// See https://clerk.com/docs/references/nextjs/auth-middleware for more information about configuring your middleware
// TODO: now make this work for dynamic pages
export default authMiddleware({
  ignoredRoutes: ["/test/[id]"],
});

export const config = {
  matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
};


Excluding a single page works fine, but when it comes to dynamic routes, it doesn't work. What am I doing wrong?
Solution
You should try ignoredRoutes: ['/test/(.*)'] instead
Was this page helpful?