-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Labels
Description
Describe the bug
When using vitest with a server configured to not use localhost, but any other domain without https, vitest fails with the exception "TypeError: crypto.randomUUID is not a function" thrown in wrapModule
| const moduleId = crypto.randomUUID() |
The function crypto.randomUUID is not available in insecure environments https://developer.mozilla.org/de/docs/Web/API/Crypto/randomUUID
In CI setups with a remote-selenium-hub it is very useful to spin up vitest-server accessable through the machines hostname, without the need to configure tls.
I consider this a regression, since a similar thing got fixed in #6079
Reproduction
plusgut/vitest-minimal-reproduction-randomuui@02a2398
System Info
System:
OS: Linux 6.18 cpe:/o:nixos:nixos:26.05 26.05 (Yarara)
CPU: (16) x64 AMD Ryzen 7 PRO 5850U with Radeon Graphics
Memory: 17.72 GB / 27.23 GB
Container: Yes
Shell: 4.2.1 - /run/current-system/sw/bin/fish
Binaries:
Node: 22.21.1 - /nix/store/l85fis49agvp5q1ild1rfh4rrgmn92sr-nodejs-22.21.1/bin/node
npm: 10.9.4 - /nix/store/l85fis49agvp5q1ild1rfh4rrgmn92sr-nodejs-22.21.1/bin/npm
Browsers:
Chromium: 143.0.7499.40
Firefox: 145.0.2
Firefox Developer Edition: 145.0.2
npmPackages:
@vitest/browser-preview: ^4.0.16 => 4.0.16
@vitest/ui: latest => 4.0.16
vite: latest => 7.3.0
vitest: latest => 4.0.16Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reloaded2