New layout.tsx after Nextjs 15 update #1502
Unanswered
luiscaceresd
asked this question in
Q&A
Replies: 3 comments 1 reply
-
Have you also switched to |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yeah, this is my routing.ts import {defineRouting} from 'next-intl/routing';
import {createNavigation} from 'next-intl/navigation';
export const routing = defineRouting({
locales: ['en', 'es', 'nl'],
defaultLocale: 'en',
alternateLinks: false
});
export type Locale = (typeof routing.locales)[number];
export const {Link, getPathname, redirect, usePathname, useRouter} =
createNavigation(routing); |
Beta Was this translation helpful? Give feedback.
1 reply
-
Try this instead, type Params = Promise<{ locale: string }>;
export default async function LocaleLayout({
children,
params,
}: {
children: React.ReactNode;
params: Params;
}) {
const { locale } = await params; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys, I'm having a difficult time upgrading to nextjs 15. I already implemented the suggested changes here: https://next-intl-docs.vercel.app/blog/next-intl-3-22#await-request-locale
But I'm still getting this error:
Error: Route "/[locale]" used
params.locale.
paramsshould be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis at createParamsAccessError (turbopack://[project]/node_modules/next/dist/src/server/request/params.ts:467:9) at getMessage (turbopack://[project]/node_modules/next/dist/src/server/create-deduped-by-callsite-server-error-logger.ts:46:20) at warnForSyncAccess (turbopack://[project]/node_modules/next/dist/src/server/request/params.ts:445:4) at syncIODev (turbopack://[project]/node_modules/next/dist/src/server/request/params.ts:403:10) at param (turbopack://[project]/node_modules/next/src/server/server-utils.ts:74:25) at pathname (turbopack://[project]/node_modules/next/src/lib/metadata/get-metadata-route.ts:40:39) at tree.children.metadata.openGraph (/home/kira/02-WORK/00-lezgo/lezgo/.next/server/chunks/ssr/node_modules_cf91f8._.js:114:241) at imageModule (turbopack://[project]/node_modules/next/dist/src/lib/metadata/resolve-metadata.ts:381:27) at Array.map (<anonymous>) at map (turbopack://[project]/node_modules/next/dist/src/lib/metadata/resolve-metadata.ts:379:58) at collectStaticImagesFiles (turbopack://[project]/node_modules/next/dist/src/lib/metadata/resolve-metadata.ts:399:4) at resolveStaticMetadata (turbopack://[project]/node_modules/next/dist/src/lib/metadata/resolve-metadata.ts:449:36) at async resolveMetadataItemsImpl (turbopack://[project]/node_modules/next/dist/src/lib/metadata/resolve-metadata.ts:548:2) at async resolveMetadataItemsImpl (turbopack://[project]/node_modules/next/dist/src/lib/metadata/resolve-metadata.ts:562:4)
I ran the nextjs 15 codemod and it updated my layout to this:
So I'm not sure why I'm getting this
Beta Was this translation helpful? Give feedback.
All reactions