Anyone else getting this error? Clerk: auth() ... looks like you aren't using `authMiddleware`
Error: Clerk: auth() was called but it looks like you aren't using
authMiddleware
in your middleware file. Please use authMiddleware
and make sure your middleware matcher is configured correctly and it matches this route or page. See https://clerk.com/docs/quickstarts/get-started-with-nextjs
nothing too crazy in my middleware, I did add the /server
in the import cause I was testing some other solutions ... however clerk and next docs do not explicitly use /server
in their middleware.tsUse Clerk with Next.js | Clerk
Learn how to use Clerk to quickly and easily add secure authentication and user management to your Next.js application. Clerk works seamlessly on both client side and server side components.
1 Reply
Also using ./app with no /src dir
./middleware.ts in root next to app dir like everyone says
"@clerk/nextjs": "^4.25.4", "next": "13.5.4",
Some other odd solutions I saw... remove loading.tsx(?) which is odd lol
update: fix for now was moving my user stuff into the client in my site header which was previously a server component