I'm getting a memory leakage warning using a standard chokidar implementation.
My code is:
watcher.on("all", () => res.write("change"));
My configuration is:
module.exports = chokidar.watch(process.cwd(), { ignoreInitial: true, ignored: [ path.join(process.cwd(), "live-html-147"), path.join(process.cwd(), "node_modules") ], usePolling: false });
The full trace is:
(node:1677) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 all listeners added to [FSWatcher]. Use emitter.setMaxListeners() to increase limit at _addListener (node:events:591:17) at FSWatcher.addListener (node:events:609:10) at /home/abenezer/projects/live-html/src/lib/sse.js:18:13 at Layer.handle [as handle_request] (/home/abenezer/projects/live-html/node_modules/express/lib/router/layer.js:95:5) at next (/home/abenezer/projects/live-html/node_modules/express/lib/router/route.js:149:13) at Route.dispatch (/home/abenezer/projects/live-html/node_modules/express/lib/router/route.js:119:3) at Layer.handle [as handle_request] (/home/abenezer/projects/live-html/node_modules/express/lib/router/layer.js:95:5) at /home/abenezer/projects/live-html/node_modules/express/lib/router/index.js:284:15 at Function.process_params (/home/abenezer/projects/live-html/node_modules/express/lib/router/index.js:346:12)
I'm using chokidar@3.6.0. With Node v18.20.3.
I'm getting a memory leakage warning using a standard chokidar implementation.
My code is:
watcher.on("all", () => res.write("change"));
My configuration is:
module.exports = chokidar.watch(process.cwd(), { ignoreInitial: true, ignored: [ path.join(process.cwd(), "live-html-147"), path.join(process.cwd(), "node_modules") ], usePolling: false });
The full trace is:
(node:1677) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 all listeners added to [FSWatcher]. Use emitter.setMaxListeners() to increase limit at _addListener (node:events:591:17) at FSWatcher.addListener (node:events:609:10) at /home/abenezer/projects/live-html/src/lib/sse.js:18:13 at Layer.handle [as handle_request] (/home/abenezer/projects/live-html/node_modules/express/lib/router/layer.js:95:5) at next (/home/abenezer/projects/live-html/node_modules/express/lib/router/route.js:149:13) at Route.dispatch (/home/abenezer/projects/live-html/node_modules/express/lib/router/route.js:119:3) at Layer.handle [as handle_request] (/home/abenezer/projects/live-html/node_modules/express/lib/router/layer.js:95:5) at /home/abenezer/projects/live-html/node_modules/express/lib/router/index.js:284:15 at Function.process_params (/home/abenezer/projects/live-html/node_modules/express/lib/router/index.js:346:12)