Skip to content
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

bunx vitest hangs #9170

Closed
cecilia-sanare opened this issue Feb 29, 2024 · 7 comments
Closed

bunx vitest hangs #9170

cecilia-sanare opened this issue Feb 29, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@cecilia-sanare
Copy link

What version of Bun is running?

1.0.28+705638470

What platform is your computer?

Linux 6.1.79 x86_64 unknown

What steps can reproduce the bug?

In this scenario I'm using nix-shell, but this happens in other environments as well.

# shell.nix
{ pkgs ? import <nixpkgs-unstable> { } }:

pkgs.mkShell {
  buildInputs = with pkgs; [
    # Without node it just silently hangs
    # nodejs_20
    bun
  ];
}

Minimum reproducible example

mkdir temp
touch temp/example.spec.ts
(cd temp && bunx vitest)

What is the expected behavior?

Bun should at the very least complain in some way and ideally inform me that installing NodeJS will likely resolve the problem.

What do you see instead?

Bun just hangs silently.
image

Additional information

I've hit this multiple times and I'm just used to assuming this is what's wrong.
However to developers that are new to bun this is an incredibly confusing scenario and most people wouldn't expect installing NodeJS to be the answer given Buns whole thing is to be a drop-in replacement even if its not 100% there yet.

@cecilia-sanare cecilia-sanare added the bug Something isn't working label Feb 29, 2024
@Electroid
Copy link
Contributor

Electroid commented Mar 1, 2024

The root cause here is a specific issue with Vitest and Bun, would you be able to share any code so we can reproduce?

@Electroid Electroid added the needs repro Needs an example to reproduce label Mar 1, 2024
@Electroid Electroid changed the title Bun silently hangs in a variety of scenarios bunx vitest hangs Mar 1, 2024
@cecilia-sanare
Copy link
Author

Hi @Electroid! I actually included a simple method of reproducing it with a few commands in the comment above.
But here's a small github repo as well that reproduces the issue.

https://github.com/cecilia-sanare/repro-bun-9170

@Electroid Electroid removed the needs repro Needs an example to reproduce label Mar 2, 2024
@Electroid
Copy link
Contributor

Duplicate of #4145

@Electroid Electroid marked this as a duplicate of #4145 Mar 4, 2024
@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
@Electroid
Copy link
Contributor

We will fix this, didn't see that we had an open issue for this already.

@paperdave
Copy link
Member

For now, it is recommended to use bun test instead of vitest, and opening issues for any features we don't support.

@cecilia-sanare
Copy link
Author

@paperdave
I mean, the entire reason I'm using vitest over bun test is due to the lack of support for exporting to lcov which already has an open issue (#4015).

Also the reason I opened this issue wasn't for the same reason as #4145.
Honestly I couldn't care less if vitest worked purely in bun or not.

My issue is that in a variety of scenarios bun will just hang silently rather then giving any indication something is wrong.

@Electroid
Copy link
Contributor

My issue is that in a variety of scenarios bun will just hang silently rather then giving any indication something is wrong.

Unfortunately, we do not have a catch-all ability to fix all scenarios where Bun hangs. If you do encounter something where Bun hangs, please report it in a seperate issue with some code so we can reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants