Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Server ] Error: Clerk: auth() was called but Clerk can't detect usage of clerkMiddleware(). Please ensure the following: - clerkMiddleware() 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 #4827

Open
4 tasks done
amin-xiv opened this issue Dec 25, 2024 · 0 comments
Labels
needs-triage A ticket that needs to be triaged by a team member

Comments

@amin-xiv
Copy link

Preliminary Checks

Reproduction

https://github.com/amin-xiv/Clerk-Issue

Publishable key

pk_test_bGlnaHQtY2ljYWRhLTM4LmNsZXJrLmFjY291bnRzLmRldiQ

Description

I have just got introduced to Clerk auth, and I'm using Next.js. I'm following this video LINE BY LINE (https://www.youtube.com/watch?v=pjFbcXi8eCM) which is the official Clerk tutorial on Next.js, but I'm getting this error:
[ Server ] Error: Clerk: auth() was called but Clerk can't detect usage of clerkMiddleware(). Please ensure the following:

  • clerkMiddleware() 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

Steps to reproduce:

  1. Step 1
  2. Step 2

Expected behavior:

It should work since I'm following the tutorial and the docs as stated in detail.

Actual behavior:

I get this error:

image

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 1.42 GB / 7.90 GB
  Binaries:
    Node: 22.12.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
  Browsers:
    Edge: Chromium (128.0.2739.42)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    @clerk/nextjs: ^6.9.6 => 6.9.6
    @eslint/eslintrc: ^3 => 3.2.0
    @types/node: ^20 => 20.17.10
    @types/react: ^19 => 19.0.2
    @types/react-dom: ^19 => 19.0.2
    eslint: ^9 => 9.17.0
    eslint-config-next: 15.1.2 => 15.1.2
    next: 15.1.2 => 15.1.2
    postcss: ^8 => 8.4.49
    react: ^19.0.0 => 19.0.0
    react-dom: ^19.0.0 => 19.0.0
    tailwindcss: ^3.4.1 => 3.4.17
    typescript: ^5 => 5.7.2
@amin-xiv amin-xiv added the needs-triage A ticket that needs to be triaged by a team member label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage A ticket that needs to be triaged by a team member
Projects
None yet
Development

No branches or pull requests

1 participant