ethereumjs-monorepo icon indicating copy to clipboard operation
ethereumjs-monorepo copied to clipboard

ethereumjs/util require node polyfill for browser

Open wighawag opened this issue 1 year ago • 3 comments

I have an issue with @ethereumjs/util It needs a node polyfill for the browser, which ideally shouldn't be necessary in a browser environment.

Here is the link to the imports in question

https://github.com/ethereumjs/ethereumjs-monorepo/blob/ee8e02f7be14f4311c2a967d9b8d9dd3ffc72166/packages/util/src/asyncEventEmitter.ts#L10

wighawag avatar May 26 '24 05:05 wighawag

This is a known issue. Unfortunately, we do not currently have an obvious solution to it aside from polyfilling with something like eventemitter3. I have not yet found a replacement for node:events that is 100% API compatible and we need deep compatibility in order to maintain the functionality of our asyncEventEmitter class.

acolytec3 avatar May 26 '24 12:05 acolytec3

@acolytec3 but we can switch over along our next breaking release round, right (or not)? That was my conclusion from the last exchange on this, but might be wrong.

@wighawag Targeted for autumn 2024 (sorry, no short cuts here unfortunately, we cannot do breaking releases too often).

holgerd77 avatar May 27 '24 06:05 holgerd77

If we can find a fully compatible event emitter class, potentially. eventEmitter3 has some incompatibility that I couldn't solve when I initially tried integrating it inside the asyncEventEmitter class. If/when we pick this up, I can explore again.

acolytec3 avatar May 27 '24 11:05 acolytec3

Superseeded (not addressed though yet) by #3636, will close.

holgerd77 avatar Sep 20 '24 08:09 holgerd77