我正在使用 NextJS 应用程序目录,没有 src 目录和 Clerk。
上面我列出了中间件页面的位置。
digest: "4053108776"
⨯ 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 src directory, make sure the Middleware file is inside of it.
For more details, see https://clerk.com/docs/quickstarts/nextjs
at $$ACTION_0 (./lib/checkUser.ts:18:89)
at Header (./components/globals/Header.tsx:18:81)
at stringify (<anonymous>)
at stringify (<anonymous>)
digest: "4053108776"
GET /_next/static/chunks/app/invalidateCache.js.map 404 in 147ms
✓ Compiled in 43ms (330 modules)
我不知道如何处理这个问题。我在这个论坛上看过很多帖子,尝试过很多,但都不起作用。
尝试将中间件放在 /app/