Skip to content

Commit

Permalink
fix fallback false for route without i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
conico974 committed Feb 20, 2024
1 parent 68858bb commit 2357429
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/open-next/src/core/routing/matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ export function handleFallbackFalse(
});
const locales = NextConfig.i18n?.locales;
const routesAlreadyHaveLocale =
locales !== undefined && locales.includes(rawPath.split("/")[1]);
(locales !== undefined && locales.includes(rawPath.split("/")[1])) ||
// If we don't use locales, we don't need to add the default locale
locales === undefined;
const localizedPath = routesAlreadyHaveLocale
? rawPath
: `/${NextConfig.i18n?.defaultLocale}${rawPath}`;
Expand Down

0 comments on commit 2357429

Please sign in to comment.