Added @clerk/nextjs and now I get 404s on my protected routes #66037
Replies: 5 comments 4 replies
-
Colin from Clerk here. We've seen this on latest as well and are investigating if it's a Next.js issue or a Clerk issue. |
Beta Was this translation helpful? Give feedback.
-
@JamesSingleton have you seen this while navigating, or only after saving and the app does a fast refresh? |
Beta Was this translation helpful? Give feedback.
-
this is a version is match it should be good after you upgrade your nextjs to latest version. |
Beta Was this translation helpful? Give feedback.
-
Im also seeing the issue, apparently only the protected routes are getting "Page not found 404" errror, i have added custom middleware for each of the protected routes, and made them public in clerk middleware.js, as my project is small, im planning to use it that way, but i do want a permanent solution fast |
Beta Was this translation helpful? Give feedback.
-
Hello guys, in my case I'm facing 404 page after refresh on protected route. @colinclerk |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I am working on adding a
/admin/*
route to my website and decided to use@clerk/nextjs
for this. However, I noticed that mynot-found.tsx
gets returned when developing locally when I am on a protected route.This is what my route structure looks like:

However, when I go to
/admin/home
or/admin/transfer-portal
I get mynot-found.tsx
In my
/admin/home/page.tsx
I haveand both return data, so I know I am logged in.
I am sure that I have something setup weird causing some potential race conditions.
Additional information
Beta Was this translation helpful? Give feedback.
All reactions