Next.js Discord

Discord Forum

Clerk middleware blocking PageSpeed Insights

Unanswered
Plott Hound posted this in #help-forum
Open in Discord
Plott HoundOP
with my desired middleware where everything is protected except for the root page:
import { authMiddleware } from "@clerk/nextjs";
 
export default authMiddleware({
  publicRoutes: ["/"],
});
 
export const config = {
  matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
};

Despite being able to access the homepage while logged out I get an error on page insights: Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 401)

If I remove the middleware it works.

Using the latest stable versions of next and clerk

1 Reply

Plott HoundOP
bump