I have some SSR routes that use getServerData to fetch some data, for example src/pages/products/[slug].tsx
These pages work correctly for the default language but for other language they contain the language twice, for example the component mentioned above becomes: /fr/fr/products/:slug
The expected behaviour would be for the page to be reachable at /fr/products/:slug, but it is not happening because this line of code duplicates the language:
I have some SSR routes that use
getServerData
to fetch some data, for example src/pages/products/[slug].tsxThese pages work correctly for the default language but for other language they contain the language twice, for example the component mentioned above becomes: /fr/fr/products/:slug
The expected behaviour would be for the page to be reachable at /fr/products/:slug, but it is not happening because this line of code duplicates the language:
https://github.com/microapps/gatsby-plugin-react-i18next/blob/2b7b55bca752b7f6cbdcfe2b6714a9bf49f04eb7/src/plugin/onCreatePage.ts#L109
Removing the entire
if
condition fixes the issue.