next-i18next: Adding `i18next-ICU` plugin gives an error

Describe the bug

When I add the i18next-ICU plugin it gives an error of

TypeError: Cannot read property 'type' of undefined
at PROJECT_DIRECTORY\node_modules\next-i18next\dist\commonjs\createClient\node.js:64:16

Occurs in next-i18next version

^8.5.0 with i18next-icu -> ^2.0.3

Steps to reproduce

Add the i18next-icu plugin

// next-i18next.config.js

const ICU = require('i18next-icu').default

module.exports = {
    i18n: {
        defaultLocale: 'en',
        locales: ['en', 'de'],
        use: [ICU],
    },
    serializeConfig: false,
}

then do the other steps for handling unserializable configs

Expected behaviour

It should work without giving an error

OS (please complete the following information)

  • Device: Desktop, Windows 10
  • Browser: Chrome 91.0.4472.101

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

Thanks @flex-junwoo 😄, will try your fix out!