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

forceConsistentCasingInFileNames doesn't work on macos and windows when import package #54565

Closed
tjx666 opened this issue Jun 7, 2023 · 5 comments
Labels
Duplicate An existing issue was already created

Comments

@tjx666
Copy link

tjx666 commented Jun 7, 2023

Bug Report

🔎 Search Terms

forceConsistentCasingInFileNames, macos, windows

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

exists on latest stable version and nightly version

⏯ Playground Link

reproduce repository

💻 Code

// We can quickly address your report if:
//  - The code sample is short. Nearly all TypeScript bugs can be demonstrated in 20-30 lines of code!
//  - It doesn't use external libraries. These are often issues with the type definitions rather than TypeScript bugs.
//  - The incorrectness of the behavior is readily apparent from reading the sample.
// Reports are slower to investigate if:
//  - We have to pare too much extraneous code.
//  - We have to clone a large repo and validate that the problem isn't elsewhere.
//  - The sample is confusing or doesn't clearly demonstrate what's wrong.
import plugin from 'unplugin-detect-duplicated-deps/Vite';

console.log(plugin);

🙁 Actual behavior

https://github.com/tjx666/ts-filename-case-issue/actions/runs/5203586299/jobs/9386641836

image

macos, windows can pass tsc check, but linux can't, linux output

> tsc --noEmit

Error: index.ts(1,20): error TS230[7](https://github.com/tjx666/ts-filename-case-issue/actions/runs/5203586299/jobs/9386641836#step:6:8): Cannot find module 'unplugin-detect-duplicated-deps/Vite' or its corresponding type declarations.ELIFECYCLETest failed. See above for more details.
Error: Process completed with exit code 1.

🙂 Expected behavior

Because I set "forceConsistentCasingInFileNames": true options, tsc should throw error on all system, not only linux

@fatcerberus
Copy link

fatcerberus commented Jun 7, 2023

forceConsistentCasingInFileNames only ensures the filenames are consistent within your codebase, not necessarily with the file system.

edit: At least that's what I've heard from maintainers. The documentation however contradicts this:

When this option is set, TypeScript will issue an error if a program tries to include a file by a casing different from the casing on disk.

Hmm.

@tjx666
Copy link
Author

tjx666 commented Jun 7, 2023

  1. maybe this is feature request, implements this can help identify problems in advance
  2. we can improve the error report, for example notify user maybe your module path case not right and provide the correct path

@tjx666
Copy link
Author

tjx666 commented Jun 7, 2023

I use macos devlop the ts code, code can pass tsc on mac machine, but can't pass the linux ci. This question took me an entire afternoon to investigate.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jun 7, 2023
@RyanCavanaugh
Copy link
Member

#21736

@tjx666
Copy link
Author

tjx666 commented Jun 7, 2023

close because duplicated

@tjx666 tjx666 closed this as completed Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants