No translations for routes using getServerSideProps
See original GitHub issue🐛 Bug Report
Nothing is being translated for any routes deployed to Vercel that are using getServerSideProps
, they are however working fine for SSG. Everything is working as expected locally.

To Reproduce
next-i18next.config.js
const path = require("path");
module.exports = {
i18n: {
defaultLocale: "en",
locales: ["en", "de", "fr"],
reloadOnPrerender: process.env.NODE_ENV === "development",
},
localePath: path.resolve("./public/locales"),
};
pages/profile.tsx
export const getServerSideProps: GetServerSideProps =>
...
return {
props: {
... ,
...(await serverSideTranslations(locale!, ["common", "profile"])),
},
};
},
});
const Profile = (
context: InferGetServerSidePropsType<typeof getServerSideProps>
) => {
const { t } = useTranslation("profile");
...
Expected behavior
Expected resolution of a key when using t("key")
Your Environment
- runtime version: v14
- i18next version: ^12.0.0
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Accessing pathname in getServerSideProps #18885 - GitHub
Translating non dynamic route segments: pages/search.js should be accessible on example.es/buscar (es) and example.co.uk/search (en).
Read more >Advanced Features: Internationalized Routing - Next.js
Next.js has built-in support for internationalized (i18n) routing since v10.0.0 . You can provide a list of locales, the default locale, and domain-specific ......
Read more >How to access locale in custom app on server-side in Next.js?
You can access the locale in your custom app's getInitialProps through the router prop. static async getInitialProps({ Component, ctx, ...
Read more >All side optimized Next.js translations - DEV Community
This happens if you're using the internationalized routing feature and are trying to generate a static HTML export by executing next export ....
Read more >next-translate-routes - npm
Flexible and translated routes for Next.js without custom server. Latest version: 1.9.1, last published: a month ago. Start using ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Upgrade to the newest Next version and next-i18next version still leads to not found translations for us on catch all routes when deploying with vercel. Seems like that vercel changed some parts of their architecture.
+1 this, We have been seeing similar behaviour since yesterday around 15:00