service · inferred from evidence
Clerk
An authentication service for web applications.
- [next app router] Clerk cant detect authMiddleware when used in Layout
Clerk cannot detect authMiddleware when it is referenced from a layout; the app throws 'Clerk: Unable to verify request, this usually means the Clerk middleware did not run.' Works in dev, breaks after build/deploy to production.
- Error: Clerk: auth() and currentUser() are only supported in App Router (/app directory).
'Clerk: auth() and currentUser() are only supported in App Router (/app directory)' even though the code is in the app directory.
- Auth data is not present on serverside - NextJS App Router
auth() and currentUser() return null on the server side in the Next.js App Router, even though the user is signed in client-side.
- Next.js authMiddleware requires an 'afterAuth' function to redirect to user page, after Google social login
After Google social login, the user is not redirected to the app page unless authMiddleware has a custom afterAuth function.
- Clerk not compatible with Next.js 15 (auth() must be async)
What this covers: Upgrading a Next.js app to Next.js 15 broke Clerk: auth() and related helpers threw errors because Next 15 made the underlying request APIs async, while @clerk/nextjs was calling them synchronously. The fix that worked: Cl