Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
12 replies
fasm

Clerk: auth() was called but it looks like you aren't using authMiddleware in your middleware file

I'm using the nextjs app dir, and my middleware is definitely being called:
export default authMiddleware({
    afterAuth: async (auth, request, evt) => {
        console.log("hello from middleware")
    }
});


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

But I still get the error that I'm not using authMiddleware when I use
   import { UserButton, auth } from '@clerk/nextjs';

    const user = auth()

Any suggestions?
Was this page helpful?