Skip to content

fallbackLng does not support object type at i18next-http-middleware version 3.8.1 any more#92

Description

@ai-supper

馃悰 Bug Report

fallbackLng does not support object type at i18next-http-middleware version 3.8.1 any more

To Reproduce

  1. We always set the fallbackLng with object as below(i18next-http-middleware version 3.8.0 ), it works.
      fallbackLng: {
        default: ['en'],
      },
  1. But after we upgrade i18next-http-middleware version 3.8.1, it has errors as below:

TypeError: _this.fallbacks.map is not a function
at /i18next-http-middleware@3.8.1/node_modules/i18next-http-middleware/esm/LanguageDetector.js:93:70
at Array.forEach ()
at LanguageDetector.detect (i18next-http-middleware@3.8.1/node_modules/i18next-http-middleware/esm/LanguageDetector.js:77:22)
at i18nextMiddleware (i18next-http-middleware@3.8.1/node_modules/i18next-http-middleware/esm/index.js:79:47)
at Layer.handle [as handle_request] (/express@4.21.2/node_modules/express/lib/router/layer.js:95:5)

if we change below , it works

      fallbackLng: ['en'],

Expected behavior

fallbackLng support the object type

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions