TS2688

Cannot find type definition file for 'vitest/globals'. The file is in the program because: Entry point of type library 'vitest/globals' specified in compilerOptions.

Broken Code ❌

{
  "compilerOptions": {
    "types": ["vitest/globals"]
  }
}

Solution:

Ensure the "vitest" type definitions are installed via npm:

Fixed Code ✔️

npm install --save-dev @types/vitest