Discrepancy in Bun vs Node parentPort.on
in async context
#15408
Labels
bug
Something isn't working
confirmed bug
We can reproduce this issue
Worker
uses the web or node worker api
What version of Bun is running?
1.1.36
What platform is your computer?
Darwin 22.4.0 arm64 arm
What steps can reproduce the bug?
Create 2 files in the same folder:
a.js
b.js
Run:
What is the expected behavior?
I expect to see the line in the callback being printed. Here's what happens when running this program through Node:
What do you see instead?
The program never prints anything, supposedly because the callback is never called in the first place.
Additional information
If you move the hot loop inside a function, and call it without
await
ing it on the top-level code, it seems like the issue 'gets fixed', which leads me to believe Bun is probably treating top-levelasync/await
differently.As in:
The text was updated successfully, but these errors were encountered: