I have a problem with my portfolio site: .
I can't test the site in PageSpeed Insights—I keep getting the error:
RPC::DEADLINE_EXCEEDED: context deadline exceeded
or a similar message.
However, Lighthouse tests work fine, and the site is already indexed.
I built it using Next.js 14.2.15
and next-intl 3.22
, so the issue might be related to redirects in the language versions or my middleware file.
Here is my middleware.ts file:
import { NextResponse } from 'next/server';
export function middleware(request) {
const { pathname, search } = request.nextUrl;
if (pathname === '/') {
return NextResponse.redirect(new URL(`/pl${search}`, request.url));
}
return NextResponse.next();
}
export const config = {
matcher: ['/'],
};