-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Describe the bug
There's a long-standing (or maybe recurring) TypeScript bug that filenames with uppercase characters are not handled properly within triple-slash directives on case-sensitive file systems. For Vitest, this means that the importMeta.d.ts file can't be referenced without causing a TypeScript error:
src/main.ts:1:23 - error TS2688: Cannot find type definition file for 'vitest/importmeta'.
1 /// <reference types="vitest/importMeta" />
~~~~~~~~~~~~~~~~~
Found 1 error in src/main.ts:1
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Note that Vite recently fixed a similar issue: vitejs/vite#13309
Reproduction
See this repository for a small project that shows the issue (only on macOS or Linux, I believe): https://github.com/macdaddyaz/vitest-import-meta-bug
yarnyarn run tsc --project ./tsconfig.jsonSystem Info
System:
OS: macOS 13.6.1
CPU: (8) arm64 Apple M1
Memory: 58.80 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.8.0 - ~/.asdf/installs/nodejs/20.8.0/bin/node
Yarn: 1.22.20 - ~/.asdf/installs/nodejs/20.8.0/bin/yarn
npm: 10.2.1 - ~/.asdf/plugins/nodejs/shims/npm
pnpm: 8.10.5 - ~/.asdf/installs/nodejs/20.8.0/bin/pnpm
Browsers:
Brave Browser: 119.1.60.118
Chrome: 119.0.6045.123
Safari: 17.1
npmPackages:
vite: ^5.0.0 => 5.0.0
vitest: ^1.0.0-beta.5 => 1.0.0-beta.5 Used Package Manager
yarn
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.
Reactions are currently unavailable