electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.49k stars 520 forks source link

(Resolved) Unable to move project past 6.4.1 due to webpack issues. #3478

Closed JoueBien closed 7 months ago

JoueBien commented 9 months ago

Pre-flight checklist

Electron Forge version

7.2.0

Electron version

v25.3.1

Operating system

Windows 11 Pro

Last known working Electron Forge version

6.4.1

Expected behavior

run start and have the app start

Actual behavior

running start fails to start the app. Error message about webpack not having polyfills for modules is displayed. The app does not start. In some cases (in versions between 7.0.0 and 6.4.2) the app starts but the errors are dumped into the JS web inspector console instead of the cli.

Error message shown with 7.2.0:

PS C:\Users\zcr22\Desktop\electron node 18\my-new-app> npm run start

> my-new-app@1.0.0 start
> electron-forge start

✔ Checking your system
✔ Locating application
✔ Loading configuration
✔ Preparing native dependencies: 2 / 2 [1s]
✔ Running generateAssets hook
✔ [plugin-webpack] Compiling main process code [0.7s]
✖ [plugin-webpack] Launching dev servers for renderer process code
  › Compilation errors in the preload: group_0:
    asset main_window/preload.js 1.28 MiB [emitted] (name: main_window)
    runtime m…

An unhandled rejection has occurred inside Forge:
Error: Compilation errors in the preload: group_0:
  asset main_window/preload.js 1.28 MiB [emitted] (name: main_window)
  runtime modules 26.4 KiB 12 modules
  modules by path ./node_modules/ 395 KiB 86 modules
  modules by path ./src/ 20.5 KiB
    modules by path ./src/electron/OSC/ 18.4 KiB
      ./src/electron/OSC/MixerEventListeners.ts 2.28 KiB [built] [code generated]
      ./src/electron/OSC/core/X32.ts 16.1 KiB [built] [code generated]
    ./src/electron/preload.ts 636 bytes [built] [code generated]
    ./src/electron/ipcRenderer/IpcRendererListeners.ts 730 bytes [built] [code generated]
    ./src/shared/helpers/time.ts 727 bytes [built] [code generated]
  modules with errors 78 bytes [errors]
    node:net 39 bytes [built] [code generated] [1 error]
    node:os 39 bytes [built] [code generated] [1 error]
  external "events" 42 bytes [built] [code generated]
  external "electron" 42 bytes [built] [code generated]

  ERROR in ./node_modules/node-gyp-build/node-gyp-build.js 1:9-22
  Module not found: Error: Can't resolve 'fs' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\node-gyp-build'   
   @ ./node_modules/node-gyp-build/index.js 4:2-49
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/poller.js 10:41-66
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/darwin.js 9:17-36
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 23:17-36 28:13-32
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/node-gyp-build/node-gyp-build.js 2:11-26
  Module not found: Error: Can't resolve 'path' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\node-gyp-build' 

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }
   @ ./node_modules/node-gyp-build/index.js 4:2-49
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/poller.js 10:41-66
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/darwin.js 9:17-36
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 23:17-36 28:13-32
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/node-gyp-build/node-gyp-build.js 3:9-22
  Module not found: Error: Can't resolve 'os' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\node-gyp-build'   

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
        - install 'os-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "os": false }
   @ ./node_modules/node-gyp-build/index.js 4:2-49
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/poller.js 10:41-66
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/darwin.js 9:17-36
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 23:17-36 28:13-32
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/linux-list.js 4:24-48
  Module not found: Error: Can't resolve 'child_process' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\bindings-cpp\dist'
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/linux.js 8:21-44
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 24:16-34 29:13-31
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/load-bindings.js 8:15-30
  Module not found: Error: Can't resolve 'util' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\bindings-cpp\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
        - install 'util'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/win32.js 9:24-50
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 25:16-34 30:13-31
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/load-bindings.js 9:15-30
  Module not found: Error: Can't resolve 'path' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\bindings-cpp\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/win32.js 9:24-50
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 25:16-34 30:13-31
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/poller.js 9:15-30
  Module not found: Error: Can't resolve 'path' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\bindings-cpp\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/darwin.js 9:17-36
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 23:17-36 28:13-32
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/unix-read.js 7:15-30
  Module not found: Error: Can't resolve 'util' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\bindings-cpp\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
        - install 'util'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/darwin.js 10:20-42
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 23:17-36 28:13-32
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/unix-read.js 8:13-26
  Module not found: Error: Can't resolve 'fs' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\bindings-cpp\dist'
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/darwin.js 10:20-42
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 23:17-36 28:13-32
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/unix-write.js 7:13-26
  Module not found: Error: Can't resolve 'fs' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\bindings-cpp\dist'
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/darwin.js 11:21-44
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 23:17-36 28:13-32
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/unix-write.js 9:15-30
  Module not found: Error: Can't resolve 'util' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\bindings-cpp\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
        - install 'util'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/darwin.js 11:21-44
   @ ./node_modules/osc/node_modules/@serialport/bindings-cpp/dist/index.js 23:17-36 28:13-32
   @ ./node_modules/osc/node_modules/serialport/dist/serialport.js 5:23-58
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 24:13-36
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/parser-byte-length/dist/index.js 4:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\parser-byte-length\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 13:13-54
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/parser-cctalk/dist/index.js 4:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\parser-cctalk\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 14:13-49
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/parser-delimiter/dist/index.js 4:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\parser-delimiter\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 15:13-52
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/parser-inter-byte-timeout/dist/index.js 4:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\parser-inter-byte-timeout\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 16:13-61
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/parser-packet-length/dist/index.js 4:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\parser-packet-length\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 17:13-56
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/parser-ready/dist/index.js 4:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\parser-ready\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 19:13-48
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/parser-regex/dist/index.js 4:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\parser-regex\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 20:13-48
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/parser-slip-encoder/dist/decoder.js 4:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\parser-slip-encoder\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/@serialport/parser-slip-encoder/dist/index.js 13:13-33
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 21:13-55
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/parser-slip-encoder/dist/encoder.js 4:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\parser-slip-encoder\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/@serialport/parser-slip-encoder/dist/index.js 14:13-33
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 21:13-55
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/parser-spacepacket/dist/index.js 4:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\parser-spacepacket\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 22:13-54
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/node_modules/@serialport/stream/dist/index.js 7:17-34
  Module not found: Error: Can't resolve 'stream' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\node_modules\@serialport\stream\dist'

  BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
  This is no longer the case. Verify if you need this module and configure a polyfill for it.

  If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
   @ ./node_modules/osc/node_modules/serialport/dist/serialport-mock.js 4:17-46
   @ ./node_modules/osc/node_modules/serialport/dist/index.js 23:13-41
   @ ./node_modules/osc/src/platforms/osc-node-serialport-loader.js 15:21-42
   @ ./node_modules/osc/src/platforms/osc-node.js 38:12-54
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/src/platforms/osc-node.js 31:16-32
  Module not found: Error: Can't resolve 'dgram' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\src\platforms'
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in ./node_modules/osc/src/platforms/osc-node.js 32:14-28
  Module not found: Error: Can't resolve 'net' in 'C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\osc\src\platforms'
   @ ./src/electron/OSC/core/X32.ts 23:14-28
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in node:net
  Module build failed: UnhandledSchemeError: Reading from "node:net" is not handled by plugins (Unhandled scheme).
  Webpack supports "data:" and "file:" URIs by default.
  You may need an additional plugin to handle "node:" URIs.
      at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\NormalModule.js:838:25
      at Hook.eval [as callAsync] (eval at create (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
      at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\Hook.js:18:14)
      at Object.processResource (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\NormalModule.js:835:8) 
      at processResource (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\loader-runner\lib\LoaderRunner.js:220:11) 
      at iteratePitchingLoaders (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\loader-runner\lib\LoaderRunner.js:171:10)
      at runLoaders (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\loader-runner\lib\LoaderRunner.js:398:2)       
      at NormalModule._doBuild (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\NormalModule.js:825:3)  
      at NormalModule.build (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\NormalModule.js:969:15)    
      at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\Compilation.js:1377:12
      at NormalModule.needBuild (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\NormalModule.js:1257:32)
      at Compilation._buildModule (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\Compilation.js:1358:10)
      at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\util\AsyncQueue.js:305:10
      at Hook.eval [as callAsync] (eval at create (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
      at AsyncQueue._startProcessing (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\util\AsyncQueue.js:295:26)
      at AsyncQueue._ensureProcessing (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\util\AsyncQueue.js:282:12)
   @ ./node_modules/get-port/index.js 1:0-27 44:17-33
   @ ./src/electron/OSC/core/X32.ts 25:35-54
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  ERROR in node:os
  Module build failed: UnhandledSchemeError: Reading from "node:os" is not handled by plugins (Unhandled scheme).
  Webpack supports "data:" and "file:" URIs by default.
  You may need an additional plugin to handle "node:" URIs.
      at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\NormalModule.js:838:25
      at Hook.eval [as callAsync] (eval at create (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
      at Object.processResource (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\NormalModule.js:835:8) 
      at processResource (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\loader-runner\lib\LoaderRunner.js:220:11) 
      at iteratePitchingLoaders (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\loader-runner\lib\LoaderRunner.js:171:10)
      at runLoaders (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\loader-runner\lib\LoaderRunner.js:398:2)       
      at NormalModule._doBuild (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\NormalModule.js:825:3)  
      at NormalModule.build (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\NormalModule.js:969:15)    
      at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\Compilation.js:1377:12
      at NormalModule.needBuild (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\NormalModule.js:1257:32)
      at Compilation._buildModule (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\Compilation.js:1358:10)
      at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\util\AsyncQueue.js:305:10
      at Hook.eval [as callAsync] (eval at create (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
      at AsyncQueue._startProcessing (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\util\AsyncQueue.js:295:26)
      at AsyncQueue._ensureProcessing (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\util\AsyncQueue.js:282:12)
      at processImmediate (node:internal/timers:478:21)
   @ ./node_modules/get-port/index.js 2:0-25 27:20-40
   @ ./src/electron/OSC/core/X32.ts 25:35-54
   @ ./src/electron/OSC/MixerEventListeners.ts 8:30-55
   @ ./src/electron/preload.ts 5:30-66

  24 errors have detailed information that is not shown.
  Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

  group_0 (webpack 5.88.2) compiled with 26 errors in 7147 ms

group_0:
  asset main_window/index.js 16.2 MiB [emitted] (name: main_window)
  asset main_window/index.html 277 bytes [emitted]
  runtime modules 27.9 KiB 16 modules
  orphan modules 4.55 KiB [orphan] 7 modules
  modules by path ./node_modules/ 5.11 MiB 1293 modules
  modules by path ./src/ 136 KiB
    modules by path ./src/shared/ 77 KiB 22 modules
    modules by path ./src/applications/ 55.7 KiB
      modules by path ./src/applications/MuteSync/ 34.6 KiB 6 modules
      modules by path ./src/applications/Workbench/ 12.9 KiB 3 modules
      modules by path ./src/applications/MeterBridge/ 3.99 KiB 2 modules
      modules by path ./src/applications/GetStarted/ 4.28 KiB 2 modules
    modules by path ./src/electron/ 1.68 KiB
      ./src/electron/renderer.ts 1010 bytes [built] [code generated]
      ./src/electron/index.tsx 709 bytes [built] [code generated]
    ./src/App.tsx 1.89 KiB [built] [code generated]
  group_0 (webpack 5.88.2) compiled successfully in 8644 ms
at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\@electron-forge\plugin-webpack\src\WebpackPlugin.ts:395:27
    at Hook.eval (eval at create (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Hook.CALL_DELEGATE [as _call] (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\Hook.js:14:14)    
    at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\MultiCompiler.js:97:22
    at Hook.eval [as callAsync] (eval at create (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:29:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\Hook.js:18:14)
    at Watching._done (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\Watching.js:299:28)
    at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\Watching.js:213:21
    at Compiler.emitRecords (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\Compiler.js:919:5)
    at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\Watching.js:191:22
    at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\Compiler.js:885:14
    at Hook.eval [as callAsync] (eval at create (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\tapable\lib\Hook.js:18:14)
    at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\webpack\lib\Compiler.js:882:27
    at C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\neo-async\async.js:2818:7
    at done (C:\Users\zcr22\Desktop\electron node 18\my-new-app\node_modules\neo-async\async.js:3522:9)

Steps to reproduce

  1. Clone Project from here: https://github.com/JoueBien/X32-OSC-Node-Bridge
  2. upgrade to 7.2.0 (Copy & replace of "^6.2.1" in package.json)
  3. start the app npm run start

Additional information

{ "name": "my-new-app", "productName": "my-new-app", "version": "1.0.0", "description": "My Electron application description", "main": ".webpack/main", "scripts": { "start": "electron-forge start", "package": "electron-forge package", "make": "electron-forge make", "publish": "electron-forge publish", "lint": "eslint --ext .ts,.tsx .", "fix": "eslint --fix --ext .tsx,.ts .", "installNode": "nvm install 20.11.0", "swapNode": "nvm use 20.11.0" }, "keywords": [], "author": { "name": "", "email": "" }, "license": "MIT", "devDependencies": { "@electron-forge/cli": "7.2.0", "@electron-forge/maker-deb": "7.2.0", "@electron-forge/maker-rpm": "7.2.0", "@electron-forge/maker-squirrel": "7.2.0", "@electron-forge/maker-zip": "7.2.0", "@electron-forge/plugin-auto-unpack-natives": "7.2.0", "@electron-forge/plugin-webpack": "7.2.0", "@josephmark/eslint-config-react": "^1.0.9", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@types/uuid": "^9.0.2", "@types/validator": "^13.7.17", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", "@vercel/webpack-asset-relocator-loader": "^1.7.3", "css-loader": "^6.8.1", "dotenv-webpack": "^8.0.1", "electron": "25.3.1", "eslint": "^8.45.0", "eslint-plugin-import": "^2.27.5", "fork-ts-checker-webpack-plugin": "^7.3.0", "node-loader": "^2.0.0", "prettier": "^3.0.0", "prettier-eslint": "^15.0.1", "style-loader": "^3.3.3", "ts-loader": "^9.4.4", "ts-node": "^10.9.1", "typescript": "~4.5.4" }, "dependencies": { "decimal.js": "^10.4.3", "electron-squirrel-startup": "^1.0.0", "fs-extra": "^11.1.1", "get-port": "^7.0.0", "osc": "^2.4.4", "px-par": "^0.2.3", "react": "^18.2.0", "react-dom": "^18.2.0", "rsuite": "^5.37.1", "serialport": "^11.0.0", "styled-components": "^6.0.4", "use-async-setstate": "^0.1.1", "use-debounce": "^9.0.4", "usehooks-ts": "^2.9.1", "uuid": "^9.0.0", "validator": "^13.9.0" } }

JoueBien commented 9 months ago

Working through this issue I seam to have resolve it:

  1. Add nodeIntegration: true, to forge.config.ts
  2. setwebPreferences to:
    webPreferences: {
      contextIsolation: true,
      nodeIntegration: true,
      preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
    },
  3. Set webpack.renderer.config.ts to actually build as web by setting the target to target: "web", This Resolved the "no using require in render" error message step 1 & 2 caused

And it all works now. For those playing a long at home this is the commit where I resolved my issue: https://github.com/JoueBien/X32-OSC-Node-Bridge/commit/76f236f67be9104dc26407546fdfaf8ace876479

This would be soooooo much easier if there were upgraded guides.