i18next-http-backend: Cannot get translation from external public URL

šŸ› Bug Report

Hi. I’m trying to load translation file from public URL but I get (failed)net::ERR_FAILED. URL is correct and I can open it from my browser.

Screenshot 2020-10-06 at 16 21 39

To Reproduce

Here is my config file:

{
    debug: true,
    lng: 'en',
    fallbackLng: 'en',
    defaultNS: 'common',
    interpolation: {
      escapeValue: false,
      format: (value, format: string | undefined) => {
        if (format === 'uppercase') {
          return value.toUpperCase();
        }
        return value;
      },
    },
    backend: {
      crossDomain: true,
      loadPath() {
        return '<S3_BUCKET>.eu-central-1.amazonaws.com/{{lng}}/{{ns}}.json';
      },
    },
  }

Expected behavior

Should load translation file

Your Environment

  • runtime version: i.e. node v12.18.4
  • i18next version: i.e. 19.7.0
  • os: Mac

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments