import { authMiddleware } from "@clerk/nextjs";
export default authMiddleware({});
export const config = {
matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'],
};
I encountered an issue with the Clerk authentication: I received an error stating that auth() was called but it appears that authMiddleware is not being used in the middleware file. It is recommended to use authMiddleware and ensure that the middleware matcher is correctly configured to match the specific route or page. In my case, I modified the middleware file to include paths targeting my api route, which is located at api/stores/route.