Middleware is not working
I am following the T3 stack tutorial and am running into an issue where my middleware just doesn't seem to be recognized. I have the exact same code as in the tutorial and it's in the same folder as in the tutorial but the console log is not coming through. Anyone else run into this issue and have a fix for it?
import { withClerkMiddleware } from "@clerk/nextjs/server";
import { NextResponse } from "next/server";
export default withClerkMiddleware(() => {
console.log("Running Clerk middleware");
return NextResponse.next();
});
// Stop Middleware running on static files
export const config = {
matcher: "/((?!_next/image|_next/static|favicon.ico).*)",
};
1 Reply
TRPC | Clerk
Learn how to integrate Clerk into your Next.js with TRPC