pinojs / sonic-boom

Extremely fast utf8 only stream implementation
MIT License
261 stars 41 forks source link

Error. EBADF bad file descriptor #172

Closed journeyANDloneliness closed 1 year ago

journeyANDloneliness commented 1 year ago

it's probably not a bug on sonic-boom side but can u help me? so i build electron app with electron builder but when i run the exe sonic-boom complains. sonic-boom runs fine when run via console. but not when i executing my app directly. so i need to using command line to run my app. another fs write from other library runs fine too.

mcollina commented 1 year ago

How do you instantiate this within electron? I think the reason for this error is that application running on windows that are not started from a terminal lacks stdout and stderr. Therefore the default (writing to stdout) throws this error.

Note that Electron might be doing something to handle this case for console.log() or other utilities, so you won't see the problem.

A PR to address this would be highly welcomed.