Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs and examples for async params in Next.js 15 #1587

Open
ChristianIvicevic opened this issue Dec 1, 2024 · 1 comment · May be fixed by #1089
Open

Update docs and examples for async params in Next.js 15 #1587

ChristianIvicevic opened this issue Dec 1, 2024 · 1 comment · May be fixed by #1089
Labels
documentation Improvements or additions to documentation

Comments

@ChristianIvicevic
Copy link

ChristianIvicevic commented Dec 1, 2024

Link to page

https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#layout

Describe the problem

The change required is pretty simple as it's just the following:

export default async function LocaleLayout({
  children,
- params: {locale},
+ params,
}: {
  children: React.ReactNode;
- params: {locale: string};
+ params: Promise<{locale: string}>;
}) {
+ const locale = (await params).locale;
// ...

The issue is that the docs wouldn't be correct for Next 14 if this diff was to be applied. As such I didn't want to open a PR straight away and wanted to start a conversation how to proceed here from a UX-perspective.

@ChristianIvicevic ChristianIvicevic added documentation Improvements or additions to documentation unconfirmed Needs triage. labels Dec 1, 2024
@ChristianIvicevic ChristianIvicevic linked a pull request Dec 1, 2024 that will close this issue
3 tasks
@amannn amannn removed the unconfirmed Needs triage. label Dec 20, 2024
@amannn
Copy link
Owner

amannn commented Dec 20, 2024

I've created a PR for Next.js to address the issue with alternate links: vercel/next.js#73431. Once that is merged, I'd like to finally suggest updating to Next.js 15 in the docs & examples (see #1089). I saw many users run into this bug so far and I can't really recommend Next.js 15 for setups with i18n routing at this point since it's too easy to miss :-/.

@amannn amannn changed the title [Docs]: App Router setup is strictly for Next v14 and not yet updated for asynchronous params in v15 Update docs and examples for async params in Next.js 15 Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants