From 84466478ff66264d5b55063fcc6bb31e6b6e8787 Mon Sep 17 00:00:00 2001 From: "[dyad]" Date: Sun, 18 Jan 2026 16:47:17 +0100 Subject: [PATCH] [dyad] Fixing next-intl configuration error - wrote 2 file(s) --- src/i18n.ts | 10 ++++------ src/middleware.ts | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/i18n.ts b/src/i18n.ts index 6410fe8..10fd8f4 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,12 +1,10 @@ +import {notFound} from 'next/navigation'; import {getRequestConfig} from 'next-intl/server'; -export const locales = ['en']; -export const defaultLocale = 'en'; - +const locales = ['en']; + export default getRequestConfig(async ({locale}) => { - if (!locales.includes(locale as any)) { - locale = defaultLocale; - } + if (!locales.includes(locale as any)) notFound(); return { messages: (await import(`../messages/${locale}.json`)).default diff --git a/src/middleware.ts b/src/middleware.ts index 093eaab..697c130 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -6,5 +6,6 @@ export default createMiddleware({ }); export const config = { - matcher: ['/((?!api|_next|_vercel|.*\\..*).*)'] + // Match only internationalized pathnames + matcher: ['/', '/(en)/:path*'] }; \ No newline at end of file