Skip to content

Cloudflare is currently down - Clerk browser relies on this #7374

@achadee

Description

@achadee

Preliminary Checks

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):
Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions