-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bun exits before await subprocess.exited
resolves
#3137
Comments
I have also hit this bug on Mac OS Ventura 13.4. I am also seeing unexpected intermittent exiting when reading stdout from a process that quickly exits. |
Might be related: #3083 |
No, any async code will exit process unless the await is on something that specifically holds the process open. |
I was working on potentially testing
Versus:
|
Prisma users are also hitting this problem: prisma/prisma#21108 |
1.0.3 now seems to work for my above example in the TS repo. I was hoping to bisect this to figure out when this was fixed, but the debug version hangs in my example for other reasons... |
Hm, but if I go back to 1.0.0, it also works again. Yeah, I have no idea :( |
in |
Many more Prisma users are hitting this now: prisma/prisma#21324 |
i lost a day to this! 😭 |
Still an issue in |
+1 to this 🤧 |
As of Bun v1.0.26, this has been fixed. If you're still experiencing this issue, let us know and we'll re-open the issue.
|
still facing the same issue :(( |
@Yadheedhya06 have you tried using Bun v1.0.26 or later? This issue wouldn't have been fixed in v1.0.3 |
Still facing the issue on 1.0.29 |
Still facing this issue on |
The snippet at the top does not reproduce in v1.0.35 @wanosoft please open a new issue and provide a reproduction. This class of bug is specific to the APIs in use, so the general issue of "bun exits early" is unfortunately not actionable |
await subprocess.exited
resolves
script terminates before async main module is complete in CONTEXT: Using a script to seed data using prisma. So might be related to what users have mentioned above. |
What version of Bun is running?
0.6.5
What platform is your computer?
Linux 5.15.0-71-generic x86_64 x86_64
What steps can reproduce the bug?
What is the expected behavior?
What do you see instead?
Additional information
The code snippet demonstrates that if an async function is not awaited then it will not fully resolve if the main module finishes processing first. The intended behaviour can be achieved if the call to
test()
is prefixed with anawait
keyword, for demonstration.But to be working as intended, async functions that are not awaited should still fully resolve even after the main module is done processing.
I brought this issue up in the Discord and was asked to raise this as an issue.
The text was updated successfully, but these errors were encountered: