You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux debian 5.10.0-11-amd64 #1 SMP Debian 5.10.92-2 (2022-02-28) x86_64 GNU/Linux
What steps will reproduce the bug?
// file test.jsconstEventEmitter=require('events');console.log('typeof',typeofEventEmitter)console.log('content of event emitter',EventEmitter)console.log('prototype of event emitter',EventEmitter.prototype)
by executing the file in bun with bun ./test.js, the output is:
typeof object
content of event emitter {}
prototype of event emitter undefined
instead executing the same script in node (16) I get:
Version
0.1.13
Platform
Linux debian 5.10.0-11-amd64 #1 SMP Debian 5.10.92-2 (2022-02-28) x86_64 GNU/Linux
What steps will reproduce the bug?
by executing the file in bun with
bun ./test.js
, the output is:instead executing the same script in node (16) I get:
How often does it reproduce? Is there a required condition?
EventEmitter appears to be empty only when it's imported via CommonJS
require
, instead with ES6 import it works as expected.What is the expected behavior?
EventEmitter should be a class with all the standard node methods
What do you see instead?
EventEmitter is an empty object
Additional information
It would be nice to make it work via require as many modules are still using the require notation to import EventEmitter.
The text was updated successfully, but these errors were encountered: