[!] Error: 'setMaxListeners' is not exported by polyfill-node.events.js, imported by node_modules/libp2p/dist/src/peer-routing.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
node_modules/libp2p/dist/src/peer-routing.js (14:9)
12: // @ts-expect-error module with no types
13: } from 'set-delayed-interval';
14: import { setMaxListeners } from 'events';
^
15: const log = logger('libp2p:peer-routing');
16: export class DefaultPeerRouting {
Error: 'setMaxListeners' is not exported by polyfill-node.events.js, imported by node_modules/libp2p/dist/src/peer-routing.js
In this instance, the events polyfiling is not necessary because the event npm package is used.
Hence I want polyfill to be skipped on the peer-routing.js file.
I am getting the following error:
In this instance, the
events
polyfiling is not necessary because theevent
npm package is used.Hence I want polyfill to be skipped on the
peer-routing.js
file.My rollup config:
I tried:
All to no avail, I am still getting the polyfill error.
What am I getting wrong?