unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic
MIT License
465 stars 22 forks source link

Ambigious error messages cause false assumptions on EventEmitter. #314

Closed anonrig closed 1 month ago

anonrig commented 1 month ago

Environment

Cloudflare

Reproduction

Create a TLS server and call .once() function

Describe the bug

Unimplemented NET server does not extend EventEmitter.

Additional context

Using TLS server .once() function will throw an error hinting towards, socket.once does not exist. Some folks are thinking that Cloudflare workers does not support node:events and particularly once function because of this error. It indeed supports once() and emitter.once()

Please look into https://alexbevi.com/blog/2024/09/11/why-cloudflare-workers-dont-work-with-mongodb/

Logs

No response