-
Notifications
You must be signed in to change notification settings - Fork 412
Description
Preliminary Checks
-
I have reviewed the documentation: https://clerk.com/docs
-
I have searched for existing issues: https://github.com/clerk/javascript/issues
-
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
-
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction
N/A
Publishable key
N/A
Description
The network request on my production application:
https://clerk.skedyul.it/npm/@clerk/clerk-js@canary/dist/clerk.browser.js
500 Internal Server Error
https://www.npmjs.com/ (currently):

It makes no sense that my site should crash because we are pulling packages in the middleware (nextjs) - the package should have a fallback dist if the fetch fails.
Environment
import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server";
// Stop Middleware running on static files
export const config = {
matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
};
const isPublicRoute = createRouteMatcher([
"",
"/",
...
]);
export default clerkMiddleware(async (auth, request) => {
if (!isPublicRoute(request)) {
await auth.protect();
}
});
// old cloerk version had version error with Next.js 15 => upgrade clerk v6
// AuthMiddleWare() is deprecated in clerk v6.0.0, use clerkMiddleware() instead
// https://clerk.com/docs/upgrade-guides/core-2/nextjs#migrating-to-clerk-middleware