Open the Vitest config and find the test environment setting, noting whether it is set at all and what value it holds.

Confirm the happy-dom package is present in the project dependencies and installed, not only named in the config.

Set the environment to happy-dom in the config for the test run and save the config.

Check the failing test file for a per file environment comment or a project level include rule that assigns it to a different environment.

Run only the one failing test file and read the first error.

Run the full suite once the single file behaves.