-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed as duplicate
Labels
Description
What version of Bun is running?
1.2.5
What platform is your computer?
Darwin 23.5.0 arm64 arm
What steps can reproduce the bug?
When running vitest
using bun
and node
is not installed on the system, vitest
hangs indefinitely without any errors.

I used the simplest failing test case I could think of:
import { expect, test } from 'vitest'
test('counter', () => {
const counter = 0
expect(counter).toBe(1)
})
Similarly, the package.json
is as simple as possible:
{
"name": "vitest-hanging-repro",
"module": "index.ts",
"type": "module",
"private": true,
"scripts": {
"test": "vitest run"
},
"devDependencies": {
"vitest": "3.0.8"
}
}
I've tried this with and without any vite and/or vitest configuration.
Repo: https://github.com/Nick-Mazuk/vitest-hanging-repro
If you use nix
, you can see that installing nodejs_22
in the flake resolves the issue.
What is the expected behavior?
Either:
vitest
is runtime agnostic and would run successfully onbun
, orvitest
deliberately only works innode
environments and should therefore error with a warning thatnode
is required.
What do you see instead?
Vitest hangs.
Additional information
I've tried resolving with bun run --bun test
. Does not affect behavior.
Also filed vitest-dev/vitest#7681 in case this is a bug in vitest and not bun.