-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: remove CustomEvent export from @libp2p/interface
#2656
Conversation
`CustomEvent` is global in Node.js as of `v18.7.0`. We support LTS and Current which means `v20+`, and Electron has upgraded to node 20 so the polyfill isn't necessary any more. BREAKING CHANGE: `@libp2p/interface` no longer exports a `CustomEvent` polyfill
@achingbrain Should we temporarily disable the interop tests in this PR and then re-enable once gossipsub upgrades it's |
@maschad it shouldn't be necessary - when ChainSafe/js-libp2p-gossipsub#500 is merged gossipsub will use the global |
We're on nodejs v18 until o1js/protokit upgrades. @libp2p says: "We support LTS and Current which means v20+" Related: - libp2p/js-libp2p#2656 - libp2p/js-libp2p#2652 Fixes error: TypeError: CustomEvent is not a constructor at TypedEventEmitter.safeDispatchEvent (file:///.../appchain-agent/node_modules/.pnpm/@libp2p+interface@1.7.0/node_modules/@libp2p/interface/dist/src/event-target.js:53:35)
I am using NodeJS 18.20.4 and get "CustomEvent is not a constructor" error. But works with NodeJS 20. Have some version of 18 been verified to work? |
@marcus-pousette --experimental-global-customevent seems to work for me, but when I import 'node:events' I don't see it on 18.15.0 |
`CustomEvent` is global in Node.js as of `v18.7.0`. We support LTS and Current which means `v20+`, and Electron has upgraded to node 20 so the polyfill isn't necessary any more. BREAKING CHANGE: `@libp2p/interface` no longer exports a `CustomEvent` polyfill
`CustomEvent` is global in Node.js as of `v18.7.0`. We support LTS and Current which means `v20+`, and Electron has upgraded to node 20 so the polyfill isn't necessary any more. BREAKING CHANGE: `@libp2p/interface` no longer exports a `CustomEvent` polyfill
CustomEvent
is global in Node.js as ofv18.7.0
. We support LTS and Current which meansv20+
, and Electron has upgraded to node 20 so the polyfill isn't necessary any more.BREAKING CHANGE:
@libp2p/interface
no longer exports aCustomEvent
polyfillChange checklist