🌐

next-i18next stopped working with ISR on AWS Amplify and Vercel

  1. Next.js 13 App with Pages Directory with next-i18next suddenly started to not translate properly, but only on ISR/SSR pages — SSG worked as expected, which meant problem happens on Functions/Lambda side. This problem occurred with code that was working for a year, so it was probably infrastructure specific. The issue was present both on Vercel and AWS Amplify
notion image
  1. After enabling debugging in next-i18next config, it seemed that it can’t load the files. There was info about missing keys, and the "loadPath": "./public/locales/{{lng}}/{{ns}}.json" seemed to be only appropriate for website.
  1. Using path.resolve fixed the problem, and changed the loadPath.
notion image
 
thanks artur for fixing that! ❤️