title: Webpack chunks are not found
body: <p>I'm trying to setup webpack in my react.js application based on <a href="https://github.com/eldrego/react-redux-starter-kit" rel="nofollow noreferrer">this starter kit</a></p>
  <p>When I start development server, application is build successfully and I can see a list of chunks generated, but then application doesn't load and I got an error in console indicating that chunks were not found.</p>
  <p>My webpack.config.js</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const path = require('path');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const { CleanWebpackPlugin } = require('clean-webpack-plugin');
  const WebpackMd5Hash = require('webpack-md5-hash');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const Dotenv = require('dotenv-webpack');
  
  const SRC_DIR = path.join(__dirname, '/src');
  const PUB_DIR = path.join(__dirname, '/public');
  const DIST_DIR = path.join(__dirname, '/dist');
  
  module.exports = {
    entry: { main: `${SRC_DIR}/index.js` },
    output: {
      path: DIST_DIR,
      chunkFilename: '[chunkhash].chunk.js',
  
    },
    resolve: {
      alias: {
        src: path.resolve(__dirname, 'src/')
      }
    },
    module: {
      rules: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          use: ['babel-loader', 'source-map-loader'],
  
        },
        {
          test: /\.(png|jpg)$/,
          use: {
            loader: 'url-loader',
          },
        },
        {
          test: /\.scss$/,
          use: [
            'style-loader',
            MiniCssExtractPlugin.loader,
            'css-loader',
            'sass-loader',
          ],
        },
        {
          test: /\.css$/,
  
          use: [
            { loader: 'style-loader' },
            {
              loader: 'css-loader',
              options: {
                modules: true
              },
            },
            { loader: 'sass-loader' }
          ]
        }
      ],
    },
    optimization: {
      splitChunks: {
        cacheGroups: {
          css: {
            test: /\.(css|sass|scss)$/,
            name: 'commons',
            chunks: 'all',
            minChunks: 2,
            enforce: true,
          },
        },
      },
    },
    plugins: [
      new CleanWebpackPlugin({
        cleanAfterEveryBuildPatterns: ['dist'],
      }),
      new MiniCssExtractPlugin({
        filename: 'style.[contenthash].css',
      }),
      new HtmlWebpackPlugin({
        inject: true,
        title: 'React-Redux-Webpack-Starter-Kit',
        template: `${PUB_DIR}/index.html`,
        filename: 'index.html',
        favicon: `${PUB_DIR}/favicon.ico`,
        meta: {
          viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no',
        },
      }),
      new WebpackMd5Hash(),
      new Dotenv(),
    ],
    devServer: {
      port: 3003,
      historyApiFallback: true,
    },
  
  };</code></pre>
  </div>
  </div>
  </p>
  <p>My packate.json</p>
  <pre><code>    {
    &quot;name&quot;: &quot;FillRX&quot;,
    &quot;author&quot;: &quot;Zoran Jeremic&quot;,
    &quot;email&quot;: &quot;zoran.jeremic@gmail.com&quot;,
    &quot;licence&quot;: &quot;UNLICENSED&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;private&quot;: true,
    &quot;scripts&quot;: {
      &quot;lint&quot;: &quot;eslint ./src&quot;,
      &quot;start&quot;: &quot;webpack-dev-server --open --mode development --watch&quot;,
      &quot;prod&quot;: &quot;webpack --mode production&quot;,
      &quot;build&quot;: &quot;cross-env NODE_ENV=production &amp;&amp; npm run prod&quot;,
      &quot;test&quot;: &quot;react-scripts test&quot;,
      &quot;eject&quot;: &quot;react-scripts eject&quot;
    },
    &quot;browserslist&quot;: {
      &quot;production&quot;: [
        &quot;&gt;0.2%&quot;,
        &quot;ie 11&quot;,
        &quot;not dead&quot;,
        &quot;not op_mini all&quot;
      ],
      &quot;development&quot;: [
        &quot;ie 11&quot;,
        &quot;last 1 chrome version&quot;,
        &quot;last 1 firefox version&quot;,
        &quot;last 1 safari version&quot;
      ]
    },
    &quot;dependencies&quot;: {
      &quot;@date-io/core&quot;: &quot;^2.5.0&quot;,
      &quot;@date-io/moment&quot;: &quot;^1.3.13&quot;,
      &quot;@fullcalendar/core&quot;: &quot;^4.4.0&quot;,
      &quot;@fullcalendar/daygrid&quot;: &quot;^4.4.0&quot;,
      &quot;@fullcalendar/interaction&quot;: &quot;^4.4.0&quot;,
      &quot;@fullcalendar/list&quot;: &quot;^4.4.0&quot;,
      &quot;@fullcalendar/react&quot;: &quot;^4.4.0&quot;,
      &quot;@fullcalendar/timegrid&quot;: &quot;^4.4.0&quot;,
      &quot;@fullcalendar/timeline&quot;: &quot;^4.4.0&quot;,
      &quot;@material-ui/core&quot;: &quot;^4.9.9&quot;,
      &quot;@material-ui/icons&quot;: &quot;^4.9.1&quot;,
      &quot;@material-ui/lab&quot;: &quot;^4.0.0-alpha.48&quot;,
      &quot;@material-ui/pickers&quot;: &quot;^3.2.10&quot;,
      &quot;@material-ui/styles&quot;: &quot;^4.9.6&quot;,
      &quot;@mdx-js/react&quot;: &quot;^1.5.8&quot;,
      &quot;@react-pdf/renderer&quot;: &quot;^1.6.8&quot;,
      &quot;@redux-saga/core&quot;: &quot;^1.1.3&quot;,
      &quot;apexcharts&quot;: &quot;^3.18.0&quot;,
      &quot;axios&quot;: &quot;^0.19.2&quot;,
      &quot;axios-mock-adapter&quot;: &quot;^1.17.0&quot;,
      &quot;babel-loader&quot;: &quot;^8.1.0&quot;,
      &quot;change-case&quot;: &quot;^4.1.1&quot;,
      &quot;chart.js&quot;: &quot;^2.9.3&quot;,
      &quot;clsx&quot;: &quot;^1.1.0&quot;,
      &quot;css-loader&quot;: &quot;^4.2.1&quot;,
      &quot;dotenv-webpack&quot;: &quot;^2.0.0&quot;,
      &quot;draft-js&quot;: &quot;^0.11.5&quot;,
      &quot;formik&quot;: &quot;^2.1.4&quot;,
      &quot;history&quot;: &quot;^4.10.1&quot;,
      &quot;immer&quot;: &quot;^6.0.3&quot;,
      &quot;immutable&quot;: &quot;^4.0.0-rc.12&quot;,
      &quot;js-cookie&quot;: &quot;^2.2.1&quot;,
      &quot;jsonwebtoken&quot;: &quot;^8.5.1&quot;,
      &quot;jss&quot;: &quot;^10.1.1&quot;,
      &quot;jss-rtl&quot;: &quot;^0.3.0&quot;,
      &quot;jwt-decode&quot;: &quot;^2.2.0&quot;,
      &quot;lodash&quot;: &quot;^4.17.19&quot;,
      &quot;moment&quot;: &quot;^2.24.0&quot;,
      &quot;nan&quot;: &quot;^2.14.1&quot;,
      &quot;node-sass&quot;: &quot;^4.14.1&quot;,
      &quot;notistack&quot;: &quot;^0.9.9&quot;,
      &quot;nprogress&quot;: &quot;^0.2.0&quot;,
      &quot;prismjs&quot;: &quot;^1.20.0&quot;,
      &quot;prop-types&quot;: &quot;^15.7.2&quot;,
      &quot;react&quot;: &quot;^16.13.1&quot;,
      &quot;react-apexcharts&quot;: &quot;^1.3.7&quot;,
      &quot;react-app-polyfill&quot;: &quot;^1.0.6&quot;,
      &quot;react-beautiful-dnd&quot;: &quot;^13.0.0&quot;,
      &quot;react-big-calendar&quot;: &quot;^0.24.1&quot;,
      &quot;react-chartjs-2&quot;: &quot;^2.9.0&quot;,
      &quot;react-dom&quot;: &quot;^16.13.1&quot;,
      &quot;react-draft-wysiwyg&quot;: &quot;^1.14.4&quot;,
      &quot;react-dropzone&quot;: &quot;^10.2.2&quot;,
      &quot;react-feather&quot;: &quot;^2.0.3&quot;,
      &quot;react-helmet&quot;: &quot;^5.2.1&quot;,
      &quot;react-markdown&quot;: &quot;^4.3.1&quot;,
      &quot;react-modal-image&quot;: &quot;^2.5.0&quot;,
      &quot;react-perfect-scrollbar&quot;: &quot;^1.5.8&quot;,
      &quot;react-quill&quot;: &quot;^1.3.5&quot;,
      &quot;react-redux&quot;: &quot;^7.2.0&quot;,
      &quot;react-router&quot;: &quot;^5.1.2&quot;,
      &quot;react-router-dom&quot;: &quot;^5.1.2&quot;,
      &quot;react-scripts&quot;: &quot;^3.4.1&quot;,
      &quot;redux&quot;: &quot;^4.0.5&quot;,
      &quot;redux-devtools-extension&quot;: &quot;^2.13.8&quot;,
      &quot;redux-form&quot;: &quot;^8.3.2&quot;,
      &quot;redux-logger&quot;: &quot;^3.0.6&quot;,
      &quot;redux-persist&quot;: &quot;^6.0.0&quot;,
      &quot;redux-saga&quot;: &quot;^1.1.3&quot;,
      &quot;redux-thunk&quot;: &quot;^2.3.0&quot;,
      &quot;sass-loader&quot;: &quot;^9.0.3&quot;,
      &quot;socket.io-client&quot;: &quot;^2.3.0&quot;,
      &quot;source-map-loader&quot;: &quot;^1.0.1&quot;,
      &quot;uuid&quot;: &quot;^7.0.3&quot;,
      &quot;webpack-dev-server&quot;: &quot;^3.11.0&quot;,
      &quot;webpack-md5-hash&quot;: &quot;^0.0.6&quot;,
      &quot;yup&quot;: &quot;^0.28.3&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;clean-webpack-plugin&quot;: &quot;^3.0.0&quot;,
      &quot;dotenv&quot;: &quot;^8.2.0&quot;,
      &quot;eslint&quot;: &quot;^6.8.0&quot;,
      &quot;eslint-config-airbnb&quot;: &quot;^18.1.0&quot;,
      &quot;eslint-config-prettier&quot;: &quot;^6.10.1&quot;,
      &quot;eslint-plugin-import&quot;: &quot;^2.20.2&quot;,
      &quot;eslint-plugin-jsx-a11y&quot;: &quot;^6.2.3&quot;,
      &quot;eslint-plugin-mdx&quot;: &quot;^1.6.8&quot;,
      &quot;eslint-plugin-prettier&quot;: &quot;^3.1.2&quot;,
      &quot;eslint-plugin-react&quot;: &quot;^7.19.0&quot;,
      &quot;eslint-plugin-react-hooks&quot;: &quot;^2.5.1&quot;,
      &quot;html-webpack-plugin&quot;: &quot;^4.3.0&quot;,
      &quot;mdx-loader&quot;: &quot;^3.0.2&quot;,
      &quot;mini-css-extract-plugin&quot;: &quot;^0.9.0&quot;,
      &quot;prettier&quot;: &quot;^1.19.1&quot;,
      &quot;typescript&quot;: &quot;^3.8.3&quot;,
      &quot;webpack&quot;: &quot;^4.44.1&quot;,
      &quot;webpack-cli&quot;: &quot;^3.3.12&quot;
    }
  }
  </code></pre>
  <p>This is the error I'm getting in console:</p>
  <p><a href="https://i.stack.imgur.com/of5aK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/of5aK.png" alt="enter image description here" /></a></p>
  <p>All these chunks that are not found are generated during the application build, but I guess my configuration can't find it:</p>
  <p><a href="https://i.stack.imgur.com/AJWZz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AJWZz.png" alt="enter image description here" /></a></p>
  <p>I didn't use webpack earlier so I'm not sure how to investigate this problem since error doesn't indicate what could be the problem, and google search gave me results indicating network problem which I don't think is the case here.</p>
  <p>I would appreciate any help and suggestion.</p>