There is an error with my clerk and middleware that I have tried to fix but nothing has worked like I tried to uninstall clerk and then reinstall it but it does nothing just shows up with this same error of
Unhandled Runtime Error
Error: Clerk: auth() was called but Clerk can't detect usage of
clerkMiddleware() (or the deprecated authMiddleware()). Please
ensure the following:
- clerkMiddleware() (or the deprecated authMiddleware()) is used
in your Next.js Middleware.
- Your Middleware matcher is configured to match this route or
page.
- If you are using the sre directory, make sure the Middleware
file is inside of it.
For more details, see https://clerk.com/docs/quickstarts/nextjs
Source <unknown>
node_modules/@clerk/nextjs/src/server/createGetAuth.ts (35:15)
<unknown>
node_modules/@clerk/nextjs/src/utils/debugLogger.ts (74:19)
auth
node_modules/@clerk/nextjs/src/app-router/server/auth.ts (24:3)
src/components/leftMenu/ProfileCard.tsx (8:23) @ ProfileCard
6 | const ProfileCard = async () > {
>
7 |
8
const {userId} = auth()
9
10 |
11 |
if (!userId) return null;
Call Stack
AsyncLocalStorage.run
node:async_hooks (346:14)
New contributor
Adam Fernandez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.