Following theo's Tutorial. After creating the private routes i'm getting this error

❌ tRPC failed on <no-path>: You need to use "authMiddleware" (or the deprecated "withClerkMiddleware") in your Next.js middleware file. You also need to make sure that your middleware matcher is configured correctly and matches this route or page. See https://clerk.com/docs/quickstarts/get-started-with-nextjs


I've tried to debug and the solution where people say to change the matcher jsut doesnt work anymore.

here's my middleware.ts file

import { authMiddleware } from "@clerk/nextjs";

export default authMiddleware();

export const config = {
  matcher: ["/(.*?trpc.*?|(?!static|.*\\..*|_next|favicon.ico).*)", "/"],
};


I now realise its because clerk has changed a lot but i really wanna finish the tutorial and not dump it halfway so help please?

@jamesperkins (tagging you because i saw on google how youve greatly helped others, i apologized if i shouldn't have)
Solution
Any Clerk gurus in here? Following the Next.js 13 getting started guide renders blank screen

this response fixed it for me. Appparently my middleware has been in the root of my folder but should have been in src. I remember theo saying put it in src but i had used clerk before and i always put it in my folder directly so i just put it there.
Was this page helpful?