Confirm which environment the failing file actually used.

Set the project environment in the Vitest config.

Or pin the environment per file when only some tests need a DOM.

Move early DOM access out of setup files.

Re-run the failing file, then the full suite.