forge icon indicating copy to clipboard operation
forge copied to clipboard

Electron-Forge - Webpack - Start - ENOSPC

Open fras2560 opened this issue 8 months ago • 0 comments

Pre-flight checklist

  • [X] I have read the contribution documentation for this project.
  • [X] I agree to follow the code of conduct that this project uses.
  • [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.4.0

Electron version

30.0.6

Operating system

Ubuntu

Last known working Electron Forge version

No response

Expected behavior

Able to start electron-app

Actual behavior

When starting the app I am running into a ENOSPC issue. It seems it watching too many files. I am able increase the limit but based upon the error message it seems to be watching node module files? I tried adding a watch ignore to the renderer webpack config as docuemented here. Still get the issue though.

An unhandled rejection has occurred inside Forge:
Error: ENOSPC: System limit for number of file watchers reached, watch '/../node_modules/webpack-dev-middleware/node_modules/ajv/dist/vocabularies/jtd/error.js'
at FSWatcher.<computed> (node:internal/fs/watchers:247:19)
    at Object.watch (node:fs:2418:34)
    at createFsWatchInstance (/../node_modules/chokidar/lib/nodefs-handler.js:119:15)
    at setFsWatchListener (/../node_modules/chokidar/lib/nodefs-handler.js:166:15)
    at NodeFsHandler._watchWithNodeFs (/../node_modules/chokidar/lib/nodefs-handler.js:331:14)
    at NodeFsHandler._handleFile (/../node_modules/chokidar/lib/nodefs-handler.js:395:23)
    at NodeFsHandler._addToNodeFs (/../node_modules/chokidar/lib/nodefs-handler.js:637:21)

Steps to reproduce

Starting an app.

Additional information

rules.push({
  test: /\.css$/,
  use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
});

export const rendererConfig: Configuration = {
  module: {
    rules,
  },
  plugins,
  watchOptions: {
    ignored: ['**/node_modules'],
  },
  resolve: {
    extensions: ['.js', '.ts', '.jsx', '.tsx', '.css'],
  },
};

fras2560 avatar Jun 05 '24 15:06 fras2560