-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Describe the bug
I am trying to upgrade to the latest Vitest 3 Beta. Our project does not use Vite for the build-pipeline (only a simple esbuild config, in fact), and we didn't need to do anything so far to get our tests running (we don't even have a vitest config).
However, after the upgrade, we suddenly see the following error in the console:
Intl.Collator is not a constructor
TypeError: Intl.Collator is not a constructor
❯ src/services/xxxxx.ts:96:24
94| };
95|
96| const nameComparator = new Intl.Collator('en', {
| ^
97| sensitivity: 'base',
98| numeric: true,
I thought it might have to do with the Vite 6 module resolution changes, but even tinkering with that one broke more than i liked. The project runs on Node v22, and Vitest v2 has worked without an issue so far.
The error also happens when I run vitest in isolation mode.
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-ptkpew1o?file=test%2Fbasic.test.ts
Once the async import gets resolved, Vitest doesn't know what Intl. is.
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (16) x64 AMD Ryzen 9 7950X 16-Core Processor
Memory: 25.82 GB / 35.24 GB
Container: Yes
Shell: 3.6.1 - /usr/bin/fish
Binaries:
Node: 22.2.0 - /mnt/wslg/runtime-dir/fnm_multishells/40485_1735384937185/bin/node
npm: 10.7.0 - /mnt/wslg/runtime-dir/fnm_multishells/40485_1735384937185/bin/npm
pnpm: 8.15.5 - /mnt/wslg/runtime-dir/fnm_multishells/40485_1735384937185/bin/pnpm
bun: 1.1.8 - ~/.bun/bin/bun
npmPackages:
vitest: 3.0.0-beta.3 => 3.0.0-beta.3Used Package Manager
pnpm
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.