Need help to solve Application error after heroku build

I have a simple React application, which should run on Heroku. The build succeeds, but if I try to access it, I get Application error. This is my webpack.config.js:

const HtmlWebPackPlugin = require("html-webpack-plugin");
console.log(__dirname);
module.exports = {
  module: {
    rules: [
      {
        test: /\.html$/,
        use: [
          {
            loader: "html-loader"
          }
        ]
      },
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader",
        }
      },
      {
        test:/\.(s*)css$/,
        use:['style-loader', 'css-loader', 'sass-loader']
      },
      {
        test: /\.(png|jpg|svg|jpeg)$/,
        loader: 'url-loader'
      },
      {
        test: /\.(ttf|woff|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
        loader: 'url-loader'
      }
    ]
  },
  plugins: [
    new HtmlWebPackPlugin({
      template: "./src/public/index.html",
      filename: "./index.html"
    })
  ]
};

My scripts from package.json:

"scripts": {
    "heroku-prebuild": "npm install --save webpack-cli -y && npm install --dev" ,
    "dev": "node_modules/.bin/webpack-dev-server --mode development --open --hot",
    "start": "node_modules/.bin/webpack --config webpack.config.js --mode production"
  },

I assume it runs heroku-prebuild and start on deployment. My dependencies and devDependencies from package.json:

"dependencies": {
    "extract-text-webpack-plugin": "^4.0.0-beta.0",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-scripts": "1.1.1",
    "resolve-url-loader": "^3.1.0",
    "serve": "^11.0.0",
    "ttf-loader": "^1.0.2",
    "webpack": "^4.30.0"
  },
  "devDependencies": {
    "@babel/core": "^7.4.3",
    "@babel/preset-env": "^7.4.3",
    "@babel/preset-react": "^7.0.0",
    "babel": "^6.23.0",
    "babel-core": "^6.26.3",
    "babel-loader": "^8.0.5",
    "babel-preset-env": "^1.7.0",
    "babel-preset-react": "^6.24.1",
    "css-loader": "^2.1.1",
    "html-loader": "^0.5.5",
    "html-webpack-plugin": "^3.2.0",
    "http-server": "^0.11.1",
    "node-sass": "^4.11.0",
    "sass-loader": "^7.1.0",
    "style-loader": "^0.23.1",
    "url-loader": "^1.1.2",
    "webpack-cli": "^3.3.0",
    "webpack-dev-server": "^3.3.1"
  }

I am pretty sure that there are some packages that are not needed, I will clean up after I make it work on Heroku.

When I push to heroku master, my build succeeds, but when I visit my web on heroku, I get Application error. If I check logs, I get something like this:

heroku logs

As far as I understand, I am missing webpack-cli? I tried installing that using heroku-prebuild script from my package.json, but the problem persists. If I run this locally with npm run dev it works perfectly.