Next.js 15 Localization error when switching languages

Describe your question/issue in detail

I tried following the following tutorial regarding Localization with Prismic in Next.js: Next.js Internationalization (i18n) Tutorial [App Router]

And for some reason, the sample content (documents), does NOT show up in the repo after following all the steps. This also goes for the repo GitHub - prismicio-community/nextjs-starter-prismic-multi-language: Multi-language project with Next.js & Prismic .. I successfully hook it up to a Prismic repo, but no sample data..

For this topic's continuation: I cloned the repo like so: npx @slicemachine/init@latest --repository <your repository name> --starter prismic-i18n-tutorial (yes, with the matching repo name I created).

That said, I created a few documents myself and continued through the tutorial and ended up making the app with locales work. (See the public repo: GitHub - HalloJo/next-prismic-locale).

BUT

I keep getting the following errors when switching between languages (which works by the way):

I would like to paste the code of my [lang]/[uid]/page.tsx in here, but that would make it too bulky IMO. I also followed the link Dynamic APIs are Asynchronous | Next.js to read about the error, but that makes me none the wiser.

Recap:

  • 2 errors; No sample content/data when cloning prismic repos and the error regarding awaiting, but it does work.

Is there something I overlooked, as I am already awaiting the params/props?

Thanks in advance for the help!

Hi @jorikvanruiswijk,

Thank you for reaching out. We've discovered an issue when installing repos from the CLI where indeed, everything gets pushed properly except the sample documents. There is a workaround, it's inelegant and we'll be looking at a solution, but it is to rerun the installation and instead of creating a new repository, when the script prompts it, link to an existing one (so for example the empty one that was just created). All the documents will be there and show up normally the second time around, and you should be able to continue normally. Apologies about that!

I'm not sure the second error you encountered is linked, but would you mind trying the workaround and letting us know if you still run in the same issue after the documents were pushed properly? Thank you :slight_smile:

Hi @Ezekiel ,

Haven’t looked into the workaround yet (sorry..), as I am more focused on finding the solution to the error in my website concerning the switching of the locale.

Any thoughts on that?

Hey @jorikvanruiswijk,

Because this might be linked to the way the project was set-up (as in the set-up might have failed due to Next.js 14/15 changes), unfortunately you’d have to try the workaround first to make sure this is ruled out. If it doesn’t fix it we’ll know that we have to look somewhere else, but if there’s a chance that does it and it’s two birds one stone, we should take that first :slight_smile:

Let me know how that goes.