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
import { authMiddleware } from '@clerk/nextjs/server';

// This example protects all routes including api/trpc routes
// Please edit this to allow other routes to be public as needed.
// See https://clerk.com/docs/references/nextjs/auth-middleware for more information about configuring your middleware
export default authMiddleware({
publicRoutes: ['/'],
});

export const config = {
matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'],
};
import { authMiddleware } from '@clerk/nextjs/server';

// This example protects all routes including api/trpc routes
// Please edit this to allow other routes to be public as needed.
// See https://clerk.com/docs/references/nextjs/auth-middleware for more information about configuring your middleware
export default authMiddleware({
publicRoutes: ['/'],
});

export const config = {
matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'],
};
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.ts
Use 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
JEM
JEM13mo ago
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
Want results from more Discord servers?
Add your server