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
❌ 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).*)", "/"],
};
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:
https://discord.com/channels/966627436387266600/1106522494439018559/1106549069381369887 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....
Jump to solution
1 Reply
Solution
Mj
Mj17mo ago
https://discord.com/channels/966627436387266600/1106522494439018559/1106549069381369887 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.
Want results from more Discord servers?
Add your server