Multilang - NextJS 14 App router


I'm currently working on making my website multilingual by following the steps outlined in this post:

My website is built using the Minimal TypeScript Starter, and I have documents available in two languages (en-us as the defaultLocale and fr-fr). The UIDs for each language are consistent.

I've carefully followed all the steps mentioned in the guide, but I'm encountering a persistent issue where the requests consistently fail with a 404 error.

To provide more context and facilitate troubleshooting, I've created a branch in my public repository

Could you please review and let me know if I'm missing something crucial in the implementation?

Best regards,

Hi @Nicoolas,

I took a quick look, and I was able to get your project working when I removed i18n configuration from the next.config.js file. I guess it was interfering with the setup shown in the blog post. And FYI, there is a link at the end of the blog post to the final website code that you can use for future troubleshooting. That's how I was able to find the difference in the next config file.

Give that a try, and your project should start working.

Hi Levi,

I found the same conclusions this morning thanks !
My IDE was not pointing the error until i fix the next.config file !
After that i was able to progress, thanks for your answer !


1 Like

@Levi It seems that in production something is going wrong.
A request return a 500 ([GET] /?nxtPlang=en-us status=500)
a function /[lang] is returning this:

RefNotFoundError: Ref not found. Ensure you have the correct ref and try again. Master ref is: ZW2tZhAAACMA0iw_
    at Client.fetch (/var/task/.next/server/chunks/5760.js:1:13735)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Client.getFirst (/var/task/.next/server/chunks/5760.js:1:6382)
    at async Client.getByUID (/var/task/.next/server/chunks/5760.js:1:7152)
    at async Index (/var/task/.next/server/app/[lang]/page.js:1:2263) {
  url: '',
  response: {
    type: 'api_notfound_error',
    message: 'Ref not found. Ensure you have the correct ref and try again. Master ref is: ZW2tZhAAACMA0iw_'

I check potential typescripts issues, no success. Any idea ?

@Levi @samlittlefair it seems related to Caching issue with Next.js App Router - Vercel Deployment - #26 by andre.lergier ?

Hi @Nicoolas,

I think it's related to that issue. Can you try to flush the cache?

Hi @Phil sorry for the delay. I tried with no success but after upgrading next from 14.0.1 to 14.0.4 fixed the problem.

1 Like