Netlify build failing, works locally

I am having some issues deploying my site. Seems like it is failing once build starts with Netlify. It works locally.

Site name: magnificent-florentine-b25b04

10:22:11 AM: ────────────────────────────────────────────────────────────────
10:22:11 AM:   1. Build command from Netlify app                             
10:22:11 AM: ────────────────────────────────────────────────────────────────
10:22:11 AM: ​
10:22:11 AM: $ npm run build
10:22:11 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
10:22:11 AM: npm WARN config location in the cache, and they are managed by
10:22:11 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
10:22:11 AM: > whsilverbacks.co.uk@0.1.0 build
10:22:11 AM: > webpack
10:22:17 AM: asset index.bundle.js 11.1 MiB [emitted] (name: main)
10:22:17 AM: asset 1.index.bundle.js 4.9 KiB [emitted]
10:22:17 AM: asset index.html 2.53 KiB [emitted]
10:22:17 AM: runtime modules 8.38 KiB 11 modules
10:22:17 AM: orphan modules 2.92 KiB [orphan] 8 modules
10:22:17 AM: modules by path ./node_modules/ 9.99 MiB 346 modules
10:22:17 AM: modules by path ./src/ 116 KiB
10:22:17 AM:   modules by path ./src/UI/ 38.3 KiB 45 modules
10:22:17 AM:   modules by path ./src/components/ 67 KiB 26 modules
10:22:17 AM:   modules by path ./src/*.css 8.01 KiB
    ./src/index.css 1.19 KiB [built] [code generated]
    ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/index.css 806 bytes [built] [code generated]
    + 2 modules
  modules by path ./src/*.js 2.9 KiB
    ./src/index.js 542 bytes [built] [code generated]
    ./src/App.js 1.87 KiB [built] [code generated]
    ./src/reportWebVitals.js 511 bytes [built] [code generated]
data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZ.. 2.17 KiB [built] [code generated]

ERROR in   Error: Child compilation failed:
  Module not found: Error: Can't resolve '/opt/build/repo/src/index.html' in '/o  pt/build/repo'
  ModuleNotFoundError: Module not found: Error: Can't resolve '/opt/build/repo/s  rc/index.html' in '/opt/build/repo'
      at /opt/build/repo/node_modules/webpack/lib/Compilation.js:2015:28
      at /opt/build/repo/node_modules/webpack/lib/NormalModuleFactory.js:798:13
      at eval (eval at create (/opt/build/repo/node_modules/tapable/lib/HookCode  Factory.js:33:10), <anonymous>:10:1)
      at /opt/build/repo/node_modules/webpack/lib/NormalModuleFactory.js:270:22
      at eval (eval at create (/opt/build/repo/node_modules/tapable/lib/HookCode  Factory.js:33:10), <anonymous>:9:1)
      at /opt/build/repo/node_modules/webpack/lib/NormalModuleFactory.js:434:22
      at /opt/build/repo/node_modules/webpack/lib/NormalModuleFactory.js:120:11
      at /opt/build/repo/node_modules/webpack/lib/NormalModuleFactory.js:670:25
      at /opt/build/repo/node_modules/webpack/lib/NormalModuleFactory.js:855:8
      at /opt/build/repo/node_modules/webpack/lib/NormalModuleFactory.js:975:5
  
  - Compilation.js:2015 
    [repo]/[webpack]/lib/Compilation.js:2015:28
  
  - NormalModuleFactory.js:798 
    [repo]/[webpack]/lib/NormalModuleFactory.js:798:13
  
  
  - NormalModuleFactory.js:270 
    [repo]/[webpack]/lib/NormalModuleFactory.js:270:22
  
  
  - NormalModuleFactory.js:434 
    [repo]/[webpack]/lib/NormalModuleFactory.js:434:22
  
  - NormalModuleFactory.js:120 
    [repo]/[webpack]/lib/NormalModuleFactory.js:120:11
  
  - NormalModuleFactory.js:670 
    [repo]/[webpack]/lib/NormalModuleFactory.js:670:25
  
  - NormalModuleFactory.js:855 
    [repo]/[webpack]/lib/NormalModuleFactory.js:855:8
  
  - NormalModuleFactory.js:975 
    [repo]/[webpack]/lib/NormalModuleFactory.js:975:5
  
  - child-compiler.js:169 
    [repo]/[html-webpack-plugin]/lib/child-compiler.js:169:18
  
  - Compiler.js:564 
    [repo]/[webpack]/lib/Compiler.js:564:11
  
  - Compiler.js:1183 
    [repo]/[webpack]/lib/Compiler.js:1183:17
  
  
  - Hook.js:18 Hook.CALL_ASYNC_DELEGATE [as _callAsync]
    [repo]/[tapable]/lib/Hook.js:18:14
  
  - Compiler.js:1179 
    [repo]/[webpack]/lib/Compiler.js:1179:33
  
  - Compilation.js:2786 finalCallback
    [repo]/[webpack]/lib/Compilation.js:2786:11
  
  - Compilation.js:3091 
    [repo]/[webpack]/lib/Compilation.js:3091:11
  
  
  - Hook.js:18 Hook.CALL_ASYNC_DELEGATE [as _callAsync]
    [repo]/[tapable]/lib/Hook.js:18:14
  


1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
webpack 5.70.0 compiled with 2 errors in 5239 ms
​
10:22:17 AM: ────────────────────────────────────────────────────────────────
10:22:17 AM:   "build.command" failed                                        
10:22:17 AM: ────────────────────────────────────────────────────────────────
10:22:17 AM: ​
10:22:17 AM:   Error message
10:22:17 AM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
10:22:17 AM: ​
10:22:17 AM:   Error location
10:22:17 AM:   In Build command from Netlify app:
10:22:17 AM:   npm run build
10:22:17 AM: ​
10:22:17 AM:   Resolved config
10:22:17 AM:   build:
10:22:17 AM:     command: npm run build
10:22:17 AM:     commandOrigin: ui
10:22:17 AM:     publish: /opt/build/repo/build
10:22:17 AM:     publishOrigin: ui
10:22:18 AM: Caching artifacts

Ok I removed webpack from the build and now it is working.