clerk / clerk-docs

The documentation content for Clerk, an authentication and user management platform.
https://clerk.com/docs
80 stars 287 forks source link

Module '"@clerk/nextjs"' has no exported member 'authMiddleware'. #1144

Closed mahmed74 closed 3 weeks ago

mahmed74 commented 1 month ago

The Clerk webhook documentation seems outdated under "Webhooks > Sync Clerk Data to your application with webhooks" (https://clerk.com/docs/integrations/webhooks/sync-data)

the auth middleware shows an import in docs

import { authMiddleware } from "@clerk/nextjs";

export default authMiddleware({ ignoredRoutes: ["/api/webhooks(.*)"], });

export const config = { matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'], };

which throws an error that Module '"@clerk/nextjs"' has no exported member 'authMiddleware'.

LekoArts commented 3 weeks ago

Hey, thanks for the issue!

import { authMiddleware } from "@clerk/nextjs" needs to be changed to import { authMiddleware } from "@clerk/nextjs/server"

If you're up for it, please open a PR improving our docs 😊 You can find all relevant information on how to get started in our contributing documentation. Thanks!