Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows build failing due to drive letter case #56575

Closed
itslenny opened this issue Nov 28, 2023 · 2 comments
Closed

Windows build failing due to drive letter case #56575

itslenny opened this issue Nov 28, 2023 · 2 comments
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@itslenny
Copy link

πŸ”Ž 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

@sheetalkamat
Copy link
Member

Please share steps to repro with the code and clear steps

@sheetalkamat sheetalkamat added the Needs More Info The issue still hasn't been fully clarified label Nov 28, 2023
@itslenny
Copy link
Author

After attempting to create a repro for this I've determined it is likely an issue with Angular and not Typescript.

I was able to create a repro with a brand new (minimal) project in Angular, but could not reproduce it with Typescript directly (outside of Angular).

I sent them an issue here: angular/angular-cli#26519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

2 participants