#i18next ant arc.codes hydration error

1 messages · Page 1 of 1 (latest)

gleaming forge
#

Hey everyone, I'm using remix-i18next together with arc.codes.
I have my translation files in /public/locales/{{lng}}.json
Locally is everything working perfectly but in the deployed version, I'm having hydration errors. The reason is, that the server doesn't find the translation file.

I have in my i18next.server.ts file, the loadPath as follows:

backend: {
      loadPath: resolve("../../public/locales/{{lng}}.json"),
    },

The path is correct since it is working locally. But in the deployed version, the resolve is not working and the server is not finding the file.

In my remix.config.js I have publicPath: "/_static/build/" because arc.codes saves everything in /_static/build/.

How can I make i18next.server.ts find the locales file in the server that have a dynamic path based on the language?

@wraith gull maybe you know?

wraith gull
#

You need to find the path for the file on your production server

#

I have never used arc.codes

gleaming forge
#

@wraith gull I end up doing it with in-memory translation files. I think it would make sense to add an example of in-memory translations to the docs of remix-i18next. Many of us struggle with the file system of the function where we deploy 😅

tawdry edge
#

Hi , Interested on how in-memory translation works. Is there already docs available?

wraith gull