Skip to content

Commit

Permalink
Add bug reproduction
Browse files Browse the repository at this point in the history
  • Loading branch information
wottpal committed Oct 25, 2024
1 parent 8fe0ade commit cdfb9de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ type Props = {
params: Promise<{locale: string}>;
};

export const dynamicParams = false

export function generateStaticParams() {
return routing.locales.map((locale) => ({locale}));
}
Expand Down
14 changes: 2 additions & 12 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import BaseLayout from '@/components/BaseLayout';
import NotFoundPage from '@/components/NotFoundPage';
import {routing} from '@/i18n/routing';

// This page renders when a route like `/unknown.txt` is requested.
// In this case, the layout at `app/[locale]/layout.tsx` receives
// an invalid value as the `[locale]` param and calls `notFound()`.
import { redirect } from 'next/navigation'

export default function GlobalNotFound() {
return (
<BaseLayout locale={routing.defaultLocale}>
<NotFoundPage />
</BaseLayout>
);
return redirect('/')
}
2 changes: 1 addition & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export const config = {

// Enable redirects that add missing locales
// (e.g. `/pathnames` -> `/en/pathnames`)
'/((?!_next|_vercel|.*\\..*).*)'
'/((?!api|_next|_vercel|.*\\..*).*)'
]
};

0 comments on commit cdfb9de

Please sign in to comment.