zoom-clone icon indicating copy to clipboard operation
zoom-clone copied to clipboard

Clerk Authentication Part

Open Madhannmady07 opened this issue 10 months ago • 6 comments

Everything worked fine untill the Clerk Part , due to the change in the version release , I couldn't able to continue the project as same as before , to be precise , i was getting this error ....

Attempted import error: 'createRouteMatcher' is not exported from '@clerk/nextjs/server' (imported as 'createRouteMatcher').

./middleware.ts Attempted import error: 'clerkMiddleware' is not exported from '@clerk/nextjs/server' (imported as 'clerkMiddleware').

it's showing it has no such modules to export.

, can someone tell me how to install "Clerk Version 5" ? or how to solve this error , bcuz in the video he was using a different way (i mean diff middleware.ts file ) and now it is showing authMiddleware ... this stresses me up , someone help me

Madhannmady07 avatar Apr 04 '24 06:04 Madhannmady07

you can try installing this in the terminal: npm install @clerk/nextjs@beta

PhungHoang1909 avatar Apr 04 '24 08:04 PhungHoang1909

can u provide me your middleware.ts file , because in my file , it says authMiddleware is deprecated , how to resolve this properly?

Madhannmady07 avatar Apr 06 '24 02:04 Madhannmady07

As @PhungHoang1909 suggested, installing the clerk's beta version solved the problem. npm install @clerk/nextjs@beta You can use clerkMiddleware() instead of authMiddleware() createRouteMatcher also works in the beta version of clerk.

aditya-2k23 avatar Apr 07 '24 12:04 aditya-2k23

As @PhungHoang1909 suggested, installing the clerk's beta version solved the problem. npm install @clerk/nextjs@beta You can use clerkMiddleware() instead of authMiddleware() createRouteMatcher also works in the beta version of clerk.

Its Out dated just. Use middleware.js from my repo and please give it a star 🌟

kunalborkar2001 avatar Apr 09 '24 14:04 kunalborkar2001

Thanks @PhungHoang1909 for this suggestion- installing the clerk's beta version really solved the problem. npm install @clerk/nextjs@beta You can use clerkMiddleware() instead of authMiddleware() createRouteMatcher also works in the beta version of clerk. till now i am not getting problems it really works .

Anand3125 avatar Apr 19 '24 04:04 Anand3125