Skip to content

Commit f63c2db

Browse files
committed
fix(nextjs): improve auth() error message to mention infrastructure failures
1 parent 79d0ecf commit f63c2db

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clerk/nextjs": patch
3+
---
4+
5+
Improved `auth()` error message when `clerkMiddleware()` is not detected to mention that infrastructure issues (e.g. edge runtime errors or platform outages) can also cause this error.

packages/nextjs/src/server/errors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const authAuthHeaderMissing = (helperName = 'auth', prefixSteps?: string[
2727
- ${prefixSteps ? [...prefixSteps, ''].join('\n- ') : ' '}clerkMiddleware() is used in your Next.js ${fileReference} file.
2828
- Your ${fileReference} matcher is configured to match this route or page.
2929
- If you are using the src directory, make sure the ${fileReference} file is inside of it.
30+
- If your ${fileReference} file and matcher are configured correctly, this error can also occur if the ${fileReference} failed to run on this request (e.g. due to an edge runtime error or platform outage).
3031
3132
For more details, see https://clerk.com/err/auth-middleware
3233
`;

0 commit comments

Comments
 (0)