title: Webpack issue when update 4.x to 5.x
body: <p>I have a problem when i updated in my project the webpack package to V5.x.
  Here is the error :
  webpack-hot-client: <code>entry</code> Object values must be an Array or Function. Please check your webpack config.</p>
  <p>Here is my package.json :</p>
  <blockquote>
  <pre><code>    &quot;*.css&quot;,
      &quot;*.scss&quot;,
      &quot;*.sass&quot;   ],   &quot;main&quot;: &quot;index.js&quot;,   &quot;scripts&quot;: {
      &quot;analyze&quot;: &quot;bnr clean:build &amp;&amp; bnr analyze&quot;,
      &quot;build:all&quot;: &quot;bnr clean:build &amp;&amp; bnr build:client &amp;&amp; bnr build:server&quot;,
      &quot;build:client&quot;: &quot;bnr clean:build &amp;&amp; bnr build:client&quot;,
      &quot;build:server&quot;: &quot;bnr clean:build  &amp;&amp; bnr build:server&quot;,
      &quot;clean&quot;: &quot;bnr clean:build&quot;,
      &quot;dev&quot;: &quot;bnr dev&quot;,
      &quot;docker&quot;: &quot;yarn docker:build &amp;&amp; yarn docker:start &amp;&amp; yarn docker:status&quot;,
      &quot;docker:build&quot;: &quot;docker-compose build --no-cache&quot;,
      &quot;docker:start&quot;: &quot;docker-compose up -d&quot;,
      &quot;docker:status&quot;: &quot;docker-compose logs -f -t&quot;,
      &quot;flow&quot;: &quot;bnr flow&quot;,
      &quot;flow:stop&quot;: &quot;bnr flow:stop&quot;,
      &quot;lint&quot;: &quot;npm-run-all lint:js lint:style lint:json&quot;,
      &quot;lint:js&quot;: &quot;bnr lint:js&quot;,
      &quot;lint:style&quot;: &quot;bnr lint:style&quot;,
      &quot;lint:json&quot;: &quot;bnr lint:json&quot;,
      &quot;prod&quot;: &quot;bnr build:client &amp;&amp; bnr build:server &amp;&amp; bnr start&quot;,
      &quot;start&quot;: &quot;bnr start&quot;,
      &quot;sitemap&quot;: &quot;node sitemap-generator.js&quot;   },   &quot;betterScripts&quot;: {
      &quot;analyze&quot;: {
        &quot;command&quot;: &quot;npx webpack -p --progress  --hide-modules --config ./tools/webpack/production.client.babel.js&quot;,
        &quot;env&quot;: {
          &quot;NODE_ENV&quot;: &quot;analyze&quot;
        }
      },
      &quot;build:client&quot;: {
        &quot;command&quot;: &quot;npx webpack --hide-modules --config ./tools/webpack/production.client.babel.js &amp;&amp; npx gulp --gulpfile
  tools/gulpfile.js&quot;,
        &quot;env&quot;: {
          &quot;NODE_ENV&quot;: &quot;production&quot;
        }
      },
      &quot;build:server&quot;: {
        &quot;command&quot;: &quot;npx babel ./src -d ./dist --copy-files &amp;&amp; npx webpack --hide-modules --config
  ./tools/webpack/production.server.babel.js&quot;,
        &quot;env&quot;: {
          &quot;NODE_ENV&quot;: &quot;production&quot;
        }
      },
      &quot;clean:build&quot;: {
        &quot;command&quot;: &quot;rimraf ./public/assets &amp;&amp; rimraf ./public/webpack-assets.json&quot;
      },
      &quot;dev&quot;: {
        &quot;command&quot;: &quot;nodemon ./index.js&quot;,
        &quot;env&quot;: {
          &quot;NODE_PATH&quot;: &quot;./src&quot;,
          &quot;NODE_ENV&quot;: &quot;development&quot;,
          &quot;PORT&quot;: 3000
        }
      },
      &quot;flow&quot;: {
        &quot;command&quot;: &quot;npx flow&quot;
      },
      &quot;flow:stop&quot;: {
        &quot;command&quot;: &quot;npx flow stop&quot;
      },
      &quot;lint:js&quot;: {
        &quot;command&quot;: &quot;npx eslint --fix ./src ./tools ./index.js&quot;
      },
      &quot;lint:json&quot;: {
        &quot;command&quot;: &quot;npx prettier --write src/**/**/*.json&quot;
      },
      &quot;lint:style&quot;: {
        &quot;command&quot;: &quot;npx stylelint --fix ./src/**/*.css, ./src/**/*.scss&quot;
      },
      &quot;start&quot;: {
        &quot;command&quot;: &quot;node ./index.js&quot;,
        &quot;env&quot;: {
          &quot;NODE_PATH&quot;: &quot;./dist&quot;,
          &quot;NODE_HOST&quot;: &quot;0.0.0.0&quot;,
          &quot;NODE_ENV&quot;: &quot;production&quot;,
          &quot;PORT&quot;: 8080
        }
      }   },   &quot;husky&quot;: {
      &quot;hooks&quot;: {
        &quot;pre-commit&quot;: &quot;lint-staged&quot;
      }   },   &quot;lint-staged&quot;: {
      &quot;*.{js,jsx}&quot;: &quot;eslint --fix&quot;,
      &quot;*.{json,md}&quot;: &quot;prettier --write&quot;,
      &quot;*.{scss,sass}&quot;: &quot;stylelint --syntax=scss&quot;   },   &quot;nodemonConfig&quot;: {
      &quot;watch&quot;: [
        &quot;src/server.js&quot;,
        &quot;src/handler.js&quot;,
        &quot;src/utils/renderHtml.js&quot;,
        &quot;src/theme/variables.scss&quot;
      ]   },   &quot;browserslist&quot;: [
      &quot;&gt; 1%&quot;,
      &quot;last 3 versions&quot;   ],   &quot;eslintIgnore&quot;: [
      &quot;tools/flow&quot;,
      &quot;public/assets&quot;   ],   &quot;dependencies&quot;: {
      &quot;@babel/cli&quot;: &quot;^7.14.5&quot;,
      &quot;@babel/plugin-proposal-export-namespace-from&quot;: &quot;^7.5.2&quot;,
      &quot;@fortawesome/fontawesome-free&quot;: &quot;^5.15.1&quot;,
      &quot;@hapi/address&quot;: &quot;^4.1.0&quot;,
      &quot;@koa/router&quot;: &quot;^10.1.1&quot;,
      &quot;@loadable/component&quot;: &quot;^5.10.2&quot;,
      &quot;@loadable/server&quot;: &quot;^5.10.2&quot;,
      &quot;@tweenjs/tween.js&quot;: &quot;^18.3.1&quot;,
      &quot;ansi-regex&quot;: &quot;^6.0.1&quot;,
      &quot;axios&quot;: &quot;^0.23.0&quot;,
      &quot;bootstrap&quot;: &quot;^5.1.3&quot;,
      &quot;chalk&quot;: &quot;^4.1.2&quot;,
      &quot;classnames&quot;: &quot;^2.2.6&quot;,
      &quot;d3-ease&quot;: &quot;^3.0.1&quot;,
      &quot;del&quot;: &quot;^6.0.0&quot;,
      &quot;esm&quot;: &quot;^3.2.25&quot;,
      &quot;glob-parent&quot;: &quot;^6.0.2&quot;,
      &quot;gulp&quot;: &quot;^4.0.2&quot;,
      &quot;gulp-cache&quot;: &quot;^1.1.3&quot;,
      &quot;gulp-imagemin&quot;: &quot;^8.0.0&quot;,
      &quot;gulp-postcss&quot;: &quot;^9.0.0&quot;,
      &quot;gulp-rename&quot;: &quot;^2.0.0&quot;,
      &quot;i18next&quot;: &quot;^21.3.2&quot;,
      &quot;i18next-browser-languagedetector&quot;: &quot;^6.1.2&quot;,
      &quot;i18next-node-fs-backend&quot;: &quot;^2.1.3&quot;,
      &quot;i18next-resource-store-loader&quot;: &quot;^0.1.2&quot;,
      &quot;i18next-xhr-backend&quot;: &quot;^3.1.2&quot;,
      &quot;imagemin-mozjpeg&quot;: &quot;^9.0.0&quot;,
      &quot;imagemin-pngquant&quot;: &quot;^9.0.2&quot;,
      &quot;koa&quot;: &quot;^2.8.1&quot;,
      &quot;koa-bodyparser&quot;: &quot;^4.2.1&quot;,
      &quot;koa-compress&quot;: &quot;^5.1.0&quot;,
      &quot;koa-favicon&quot;: &quot;^2.0.1&quot;,
      &quot;koa-helmet&quot;: &quot;^6.1.0&quot;,
      &quot;koa-i18next-detector&quot;: &quot;^0.7.2&quot;,
      &quot;koa-i18next-middleware&quot;: &quot;^1.1.12&quot;,
      &quot;koa-i18next-middleware-fixed&quot;: &quot;^1.1.10-b3&quot;,
      &quot;koa-morgan&quot;: &quot;^1.0.1&quot;,
      &quot;koa-mount&quot;: &quot;^4.0.0&quot;,
      &quot;koa-router&quot;: &quot;^10.1.1&quot;,
      &quot;koa-static&quot;: &quot;^5.0.0&quot;,
      &quot;koa-webpack&quot;: &quot;^6.0.0&quot;,
      &quot;koa-webpack-server&quot;: &quot;^0.2.4&quot;,
      &quot;micro-dash&quot;: &quot;^8.1.0&quot;,
      &quot;moment&quot;: &quot;^2.24.0&quot;,
      &quot;p-min-delay&quot;: &quot;^4.0.1&quot;,
      &quot;pm2&quot;: &quot;^5.1.2&quot;,
      &quot;qs&quot;: &quot;^6.8.0&quot;,
      &quot;rc-animate&quot;: &quot;^3.1.1&quot;,
      &quot;rc-queue-anim&quot;: &quot;^2.0.0&quot;,
      &quot;rc-scroll-anim&quot;: &quot;^2.6.1&quot;,
      &quot;rc-tween-one&quot;: &quot;^2.6.3&quot;,
      &quot;react&quot;: &quot;^17.0.2&quot;,
      &quot;react-bootstrap&quot;: &quot;^1.0.0-beta.8&quot;,
      &quot;react-dom&quot;: &quot;npm:@hot-loader/react-dom@^16.8.6&quot;,
      &quot;react-global-configuration&quot;: &quot;^1.4.1&quot;,
      &quot;react-gtm-module&quot;: &quot;^2.0.11&quot;,
      &quot;react-helmet&quot;: &quot;^6.1.0&quot;,
      &quot;react-i18next&quot;: &quot;^11.12.0&quot;,
      &quot;react-icons&quot;: &quot;^4.3.1&quot;,
      &quot;react-motion&quot;: &quot;^0.5.2&quot;,
      &quot;react-player&quot;: &quot;^2.9.0&quot;,
      &quot;react-pose&quot;: &quot;^4.0.8&quot;,
      &quot;react-router&quot;: &quot;^5.0.1&quot;,
      &quot;react-router-config&quot;: &quot;^5.0.1&quot;,
      &quot;react-router-dom&quot;: &quot;^5.0.1&quot;,
      &quot;react-router-last-location&quot;: &quot;^2.0.1&quot;,
      &quot;react-router-sitemap&quot;: &quot;^1.2.0&quot;,
      &quot;react-spring&quot;: &quot;^9.3.0&quot;,
      &quot;react-tilt&quot;: &quot;^0.1.4&quot;,
      &quot;react-typist&quot;: &quot;^2.0.5&quot;,
      &quot;react-youtube&quot;: &quot;^7.9.0&quot;,
      &quot;sass-resources-loader&quot;: &quot;^2.0.1&quot;,
      &quot;serialize-javascript&quot;: &quot;^6.0.0&quot;,
      &quot;styled-components&quot;: &quot;^5.3.1&quot;,
      &quot;terser-webpack-plugin&quot;: &quot;^5.2.4&quot;   },   &quot;devDependencies&quot;: {
      &quot;@babel/core&quot;: &quot;^7.6.0&quot;,
      &quot;@babel/node&quot;: &quot;^7.14.5&quot;,
      &quot;@babel/plugin-proposal-class-properties&quot;: &quot;^7.5.5&quot;,
      &quot;@babel/plugin-proposal-export-default-from&quot;: &quot;^7.5.2&quot;,
      &quot;@babel/plugin-proposal-optional-chaining&quot;: &quot;^7.6.0&quot;,
      &quot;@babel/plugin-syntax-dynamic-import&quot;: &quot;^7.2.0&quot;,
      &quot;@babel/preset-env&quot;: &quot;^7.14.5&quot;,
      &quot;@babel/preset-flow&quot;: &quot;^7.0.0&quot;,
      &quot;@babel/preset-react&quot;: &quot;^7.14.5&quot;,
      &quot;@babel/register&quot;: &quot;^7.6.0&quot;,
      &quot;@babel/runtime&quot;: &quot;^7.6.0&quot;,
      &quot;@loadable/babel-plugin&quot;: &quot;^5.10.0&quot;,
      &quot;@loadable/webpack-plugin&quot;: &quot;^5.7.1&quot;,
      &quot;asset-require-hook&quot;: &quot;^1.2.0&quot;,
      &quot;babel-eslint&quot;: &quot;^10.0.3&quot;,
      &quot;babel-loader&quot;: &quot;^8.0.6&quot;,
      &quot;babel-plugin-dynamic-import-node&quot;: &quot;^2.3.0&quot;,
      &quot;babel-plugin-istanbul&quot;: &quot;^6.1.1&quot;,
      &quot;babel-plugin-transform-react-remove-prop-types&quot;: &quot;^0.4.24&quot;,
      &quot;babel-plugin-transform-remove-console&quot;: &quot;^6.9.4&quot;,
      &quot;better-npm-run&quot;: &quot;^0.1.1&quot;,
      &quot;compression-webpack-plugin&quot;: &quot;^9.0.0&quot;,
      &quot;core-js&quot;: &quot;3&quot;,
      &quot;css-loader&quot;: &quot;^6.4.0&quot;,
      &quot;css-modules-require-hook&quot;: &quot;^4.2.3&quot;,
      &quot;cssnano&quot;: &quot;^5.0.8&quot;,
      &quot;eslint&quot;: &quot;^8.0.1&quot;,
      &quot;eslint-config-airbnb&quot;: &quot;^18.0.1&quot;,
      &quot;eslint-config-prettier&quot;: &quot;^8.3.0&quot;,
      &quot;eslint-import-resolver-webpack&quot;: &quot;^0.13.1&quot;,
      &quot;eslint-plugin-flowtype&quot;: &quot;^6.1.1&quot;,
      &quot;eslint-plugin-import&quot;: &quot;^2.18.2&quot;,
      &quot;eslint-plugin-jsx-a11y&quot;: &quot;^6.2.3&quot;,
      &quot;eslint-plugin-prettier&quot;: &quot;^4.0.0&quot;,
      &quot;eslint-plugin-react&quot;: &quot;^7.14.3&quot;,
      &quot;eslint-plugin-react-hooks&quot;: &quot;^4.2.0&quot;,
      &quot;file-loader&quot;: &quot;^6.2.0&quot;,
      &quot;flow-bin&quot;: &quot;^0.162.0&quot;,
      &quot;friendly-errors-webpack-plugin&quot;: &quot;^1.7.0&quot;,
      &quot;html-minifier&quot;: &quot;^4.0.0&quot;,
      &quot;husky&quot;: &quot;^7.0.2&quot;,
      &quot;imagemin-webpack-plugin&quot;: &quot;^2.4.2&quot;,
      &quot;lint-staged&quot;: &quot;^11.2.3&quot;,
      &quot;mini-css-extract-plugin&quot;: &quot;^2.4.2&quot;,
      &quot;nodemon&quot;: &quot;^2.0.13&quot;,
      &quot;normalize.css&quot;: &quot;^8.0.1&quot;,
      &quot;npm-run-all&quot;: &quot;^4.1.5&quot;,
      &quot;optimize-css-assets-webpack-plugin&quot;: &quot;^6.0.1&quot;,
      &quot;postcss&quot;: &quot;^8.3.9&quot;,
      &quot;postcss-loader&quot;: &quot;^6.2.0&quot;,
      &quot;postcss-preset-env&quot;: &quot;^6.7.0&quot;,
      &quot;prettier&quot;: &quot;^2.4.1&quot;,
      &quot;react-dev-utils&quot;: &quot;^11.0.4&quot;,
      &quot;react-hot-loader&quot;: &quot;^4.12.13&quot;,
      &quot;react-router-sitemap-generator&quot;: &quot;^0.0.8&quot;,
      &quot;react-test-renderer&quot;: &quot;^17.0.2&quot;,
      &quot;rimraf&quot;: &quot;^3.0.0&quot;,
      &quot;sass&quot;: &quot;^1.43.2&quot;,
      &quot;sass-loader&quot;: &quot;^12.2.0&quot;,
      &quot;static-site-generator-webpack-plugin&quot;: &quot;^3.4.2&quot;,
      &quot;stylelint&quot;: &quot;^13.13.1&quot;,
      &quot;stylelint-config-prettier&quot;: &quot;^9.0.3&quot;,
      &quot;stylelint-config-recommended-scss&quot;: &quot;^4.3.0&quot;,
      &quot;stylelint-config-standard&quot;: &quot;^22.0.0&quot;,
      &quot;stylelint-scss&quot;: &quot;^3.10.1&quot;,
      &quot;url-loader&quot;: &quot;^4.1.1&quot;,
      &quot;webpack&quot;: &quot;^5.58.2&quot;,
      &quot;webpack-bundle-analyzer&quot;: &quot;^4.5.0&quot;,
      &quot;webpack-cli&quot;: &quot;4.9.1&quot;,
      &quot;webpack-dev-middleware&quot;: &quot;^5.2.1&quot;,
      &quot;webpack-hot-middleware&quot;: &quot;^2.25.0&quot;,
      &quot;webpack-manifest-plugin&quot;: &quot;^4.0.2&quot;,
      &quot;webpack-merge&quot;: &quot;^5.8.0&quot;,
      &quot;webpack-node-externals&quot;: &quot;^3.0.0&quot;   },   &quot;engines&quot;: {
      &quot;node&quot;: &quot;&gt;=8&quot;,
      &quot;npm&quot;: &quot;&gt;=5&quot;   } }```
  </code></pre>
  </blockquote>
  <p>Here is my base.config.js of webpack :</p>
  <pre><code>import webpack from 'webpack'
  import { WebpackManifestPlugin } from 'webpack-manifest-plugin'
  import MiniCssExtractPlugin from 'mini-css-extract-plugin'
  import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin'
  import LoadablePlugin from '@loadable/webpack-plugin'
  import config from './config'
  
  const nodeEnv = process.env.NODE_ENV || 'development'
  const isDev = nodeEnv === 'development'
  
  const getPlugins = () =&gt; {
    const plugins = [
      new WebpackManifestPlugin({
        fileName: path.resolve(process.cwd(), 'public/webpack-assets.json'),
        filter: file =&gt; file.isInitial
      }),
      new MiniCssExtractPlugin({
        filename: `${config.cssFileName}.css`,
        chunkFilename: `${config.cssChunkFileName}.css`,
        ignoreOrder: true
      }),
      // Setup environment variables for client
      new webpack.EnvironmentPlugin({ NODE_ENV: JSON.stringify(nodeEnv) }),
      // Setup global variables for client
      new webpack.DefinePlugin({
        __CLIENT__: true,
        __SERVER__: false,
        __DEV__: isDev
      }),
      new LoadablePlugin({ filename: '../loadable-stats.json', writeToDisk: true })
    ]
  
    if (isDev) {
      plugins.push(new FriendlyErrorsWebpackPlugin())
    }
    return plugins
  }
  
  // Webpack configuration
  module.exports = {
    mode: isDev ? 'development' : 'production',
    devtool: isDev ? 'eval-source-map' : 'hidden-source-map',
    context: path.resolve(process.cwd()),
    entry: ['webpack-hot-middleware/client','./src/index.js'],
    optimization: {
      splitChunks: {
        chunks: 'async'
      }
    },
    output: {
      path: path.resolve(process.cwd(), 'public/assets'),
      publicPath: '/assets/',
      filename: `${config.fileName}.js`,
      chunkFilename: `${config.chunkFileName}.js`,
      pathinfo: isDev
    },
    module: {
      rules: [
        {
          test: /\.jsx?$/,
          exclude: /node_modules/,
          loader: 'babel',
          options: { cacheDirectory: isDev }
        },
        {
          test: /\.css$/,
          include: /node_modules/,
          use: [
            MiniCssExtractPlugin.loader,
            {
              loader: 'css',
              options: {
                importLoaders: 1,
                modules: false,
                sourceMap: true
              }
            },
            { loader: 'postcss', options: { sourceMap: true } }
          ]
        },
        {
          test: /\.(scss|sass)$/,
          exclude: path.resolve(__dirname, '..', '..', 'src/theme/'),
          use: [
            {
              loader: MiniCssExtractPlugin.loader,
              options: {
                hmr: isDev,
                reloadAll: true
              }
            },
            {
              loader: 'css',
              options: {
                importLoaders: 2,
                modules: {
                  localIdentName: config.cssModulesIdentifier,
                  context: path.resolve(process.cwd(), 'src')
                },
                sourceMap: true
              }
            },
            { loader: 'postcss', options: { sourceMap: true } },
            {
              loader: 'sass',
              options: {
                sassOptions: {
                  outputStyle: 'expanded'
                },
                sourceMap: true
              }
            },
            {
              loader: 'sass-resources',
              options: {
                resources: path.resolve(process.cwd(), 'src/theme/_include.scss')
              }
            }
          ]
        },
        {
          test: /\.(scss|sass)$/,
          include: path.resolve(__dirname, '..', '..', 'src/theme/'),
          use: [
            {
              loader: MiniCssExtractPlugin.loader,
              options: {
                hmr: isDev,
                reloadAll: true
              }
            },
            {
              loader: 'css',
              options: {
                importLoaders: 2,
                modules: false,
                sourceMap: true
              }
            },
            { loader: 'postcss', options: { sourceMap: true } },
            {
              loader: 'sass',
              options: {
                sassOptions: {
                  outputStyle: 'expanded'
                },
                sourceMap: true
              }
            }
          ]
        },
        {
          test: path.resolve(process.cwd(), 'src/locales'),
          loader: 'i18next-resource-store-loader'
        },
        {
          test: /\.(woff2?|ttf|eot|svg|otf)$/,
          loader: 'url',
          options: { limit: 10240, name: config.staticFilesName }
        },
        {
          test: /\.(gif|png|jpe?g|webp)$/,
          // Any image below or equal to 10Kb will be converted to base64
          loader: 'url',
          options: { limit: 10240, name: config.staticFilesName }
        },
        {
          test: /\.(mp3|mp4|ogv)$/,
          loader: 'file',
          options: { name: config.staticFilesName }
        }
      ]
    },
    plugins: getPlugins(),
    resolveLoader: {
      mainFields: ['loader']
    },
    resolve: {
      modules: ['src', 'node_modules'],
      descriptionFiles: ['package.json'],
      extensions: ['.js', '.jsx', '.json'],
      fallback:{
        fs: false,
        vm: false,
        net: false,
        tls: false
      }
    },
    cache: isDev,
    stats: { children: false }
  </code></pre>
  <p>I tried a lot of things and i fixed a lot of issues but for me the entry is an Array, so i don't know why i got this error.</p>
  <p>Here there is my server.js (he launches all the programs) :</p>
  <pre><code>import logger from 'koa-morgan'
  import Koa from 'koa'
  import bodyParser from 'koa-bodyparser'
  import compression from 'koa-compress'
  import helmet from 'koa-helmet'
  import querystring from 'qs'
  import Router from '@koa/router'
  import favicon from 'koa-favicon'
  import axios from 'axios'
  import chalk from 'chalk'
  import mount from 'koa-mount'
  import serve from 'koa-static'
  import Backend from 'i18next-node-fs-backend'
  import i18n from 'i18next'
  import i18nextMiddleware from 'koa-i18next-middleware-fixed'
  import LanguageDetector from 'koa-i18next-detector'
  import c from './config'
  
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0
  const app = new Koa()
  const router = new Router()
  const sendMessage = body =&gt;
    new Promise((resolve, reject) =&gt; {
      const config = {
        maxRedirects: 0,
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded'
        }
      }
  
      axios
        .post(
          'https://go.pardot.com/l/138941/2019-07-22/2h6dgb',
          querystring.stringify({ ...body, privacy: true }),
          config
        )
        .then(result =&gt; {
          resolve(result.status === 200)
        })
        .catch(e =&gt; {
          reject(new Error(e))
        })
    })
  
  const lngDetector = new LanguageDetector()
  
  i18n
    .use(Backend)
    .use(lngDetector)
    .init(
      {
        debug: false,
        fallbackLng: 'fr',
        saveMissing: false,
        react: {
          useSuspense: false
        },
        detection: {
          order: ['path', 'navigator']
        },
        interpolation: {
          escapeValue: false,
          formatSeparator: ',',
          format: (value, format) =&gt; {
            if (format === 'uppercase') return value.toUpperCase()
            return value
          }
        },
        preload: ['fr'],
        load: 'languageOnly',
        ns: [
          'global',
          'landing_references',
          'landing_expertises',
          'home',
          'references',
          'expertises',
          'contact',
          'about',
          'partners',
          'team'
        ],
        defaultNS: 'global',
        backend: {
          loadPath: `${path.resolve(process.cwd(), 'src')}/locales/{{lng}}/{{ns}}.json`
        }
      },
      async () =&gt; {
        // Use helmet to secure Express with various HTTP headers
        app.use(helmet())
        app.use(bodyParser())
        // Compress all requests
        app.use(compression())
        // Use for http request debug (show errors only)
        app.use(logger('dev', { skip: ctx =&gt; ctx.status &lt; 400 }))
        app.use(favicon(path.resolve(process.cwd(), 'public/favicon.ico')))
        app.use(i18nextMiddleware.getHandler(i18n, { locals: 'lng' }))
  
        // Docker serve static trough nginx for better performance
        if (!__DOCKER__) {
          console.log(chalk.magenta('==&gt;   Serve statics with koa'))
          app.use(mount('/locales', serve(path.resolve(process.cwd(), 'src/locales'))))
          app.use(serve(path.resolve(process.cwd(), 'public')))
        }
        if (__DEV__) {
          app.use(mount('/images', serve(path.resolve(process.cwd(), 'src/images'))))
          /* Run express as webpack dev server */
          const webpack = require('webpack')
          const webpackConfig = require('../tools/webpack/base.config')
          const compiler = webpack(webpackConfig)
            const koaWebpack = require('koa-webpack')
          new webpack.ProgressPlugin().apply(compiler)
  
          const options = {
              compiler,
            devMiddleware: {
              publicPath: webpackConfig.output.publicPath,
              headers: { 'Access-Control-Allow-Origin': '*' },
              hot: true,
              writeToDisk: false,
              quiet: true, // Turn it on for friendly-errors-webpack-plugin
              noInfo: true,
              stats: 'minimal',
              serverSideRender: true
            }
          }
  
          const middleware = await koaWebpack(options)
          app.use(middleware)
        }
  
        router
          .post('/contact', async ctx =&gt; {
            try {
              await sendMessage(ctx.request.body)
              ctx.body = {
                message: 'Votre message a bien été envoyé'
              }
              ctx.status = 200
            } catch (e) {
              ctx.body = {
                message: 'Une erreur est survenue'
              }
              ctx.status = 500
            }
          })
          .get('/', async ctx =&gt; {
            ctx.status = 302
            return ctx.redirect(`/${ctx.request.language}`)
          })
  
          .get('*', async (ctx, next) =&gt; {
            return require('./render')(ctx, next)
          })
  
        app.use(router.routes()).use(router.allowedMethods())
        if (c.port) {
          app.listen(c.port, c.host, err =&gt; {
            const url = `http://${c.host}:${c.port}`
  
            if (err) console.error(chalk.red(`\n==&gt; Error happen ${err}`))
            console.info(chalk.green(`\n==&gt;   Listening at ${url}`))
          })
        } else {
          console.error(chalk.red('\n==&gt; Error : No PORT environment variable has been specified'))
        }
      }
    )
  </code></pre>
  <p>UPDATE :
  I put some console.log in the compiler file :</p>
  <pre><code>      for (const key of Object.keys(entry)) {
          const value = entry[key];
          console.log(entry)
          console.log(value)
          console.log(Array.isArray(Object.values(value)))
          if (!Array.isArray(value)) {
            throw new TypeError(
              'webpack-hot-client: `entry` Object values must be an Array or Function. Please check your webpack config.'
            );
  </code></pre>
  <p>Console.log return this :</p>
  <pre><code>  main: { import: [ 'webpack-hot-middleware/client', './src/index.js' ] }
  }
  { import: [ 'webpack-hot-middleware/client', './src/index.js' ] }
  true
  </code></pre>
  <p>So i think that there is a problem with the declaration of variable, because we have to do an Object.values() to get the array.
  So idk what can i do to resolve the problem, i will not change the dependencies files...
  Thx for your time and your response!</p>
  <p>Regards</p>