Skip to content

Windows build failing due to drive letter caseΒ #56575

Description

@itslenny

πŸ”Ž Search Terms

drive letter case sensitive windows

πŸ•— Version & Regression Information

  • This is a crash
  • This changed between versions 4.9.5 and 5.2.2

⏯ Playground Link

No response

πŸ’» Code

// Your code here

πŸ™ Actual behavior

When a windows cmd prompt is opened with the lower case drive letter c:\ the build fails, but when the drive letter is capital C:\ it succeeds.

error:

File 'src\main.ts' is missing from the TypeScript compilation

ERROR File 'src\polyfills.ts' is missing from the TypeScript compilation

Ensure the file is part of the TypeScript program via 'files' or 'include' property

πŸ™‚ Expected behavior

The build should succeed regardless of the case of the drive letter as they are case insensitive and do not effect portability to case-sensitive platforms. Also, the paths specified in code are relative and appear to be resolved to absolute paths by the compiler so there is not a way to fix this with changes to client code.

Additional information about the issue

This was noticed because we had a shortcut with a "start in" path starting with a lowercase c:\, but when cmd is opened using the run window (CMD+R, "cmd") the drive letter is uppercase C:\. The build would consistently fail from the cmd window launched via shortcut until the "start in" path was changed to uppercase. In our case this was a simple workaround, but there are situations (e.g. CI/CD) where the user may not have control over the environment's drive letter case.

The issue did not occur on TypeScript 4.9.5 and began happening when we recently upgraded to 5.2.2

It appears a similar issue was raised before and fixed (in 2019), but that was related to forceConsistentCasingInFileNames. However, I set this value to false in our tsconfig and the build still failed. It would only succeed if the cmd window path started with a capital drive letter.

Previous Issue: #31327

Previous PR: #31503

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions