question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion: case-sensitive imports

See original GitHub issue

TypeScript Version: 2.7.0-dev.201xxxxx

My mac does not have case sensitive imports. That is you can import the file x.js as ./X.js and everything will work. However, our servers run on linux (like most) and I got a runtime exception that took down the whole server because linux imports are case sensitive.

I think this would be an awesome addition to Typescript to prevent fatal mistakes that are hard to catch like this one.

Related Issues:

https://github.com/Microsoft/TypeScript/issues/14460

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:64
  • Comments:28 (8 by maintainers)

github_iconTop GitHub Comments

28reactions
tomgrunercommented, Sep 4, 2018

Can I upvote this issue?

I spent hours trying to figure out why my TeamCity build was failing only to realize that the project had some imports that were the wrong case!

Quite an unexpected gotcha as I thought OSX would not import the file if it was the wrong case.

11reactions
shaunluttincommented, Apr 22, 2019

I should add the reason why we did not do that is realPath has negative perf implications.

Make it opt-in with a flag like enforceCaseSensitiveFileSystemWithSlowerCompilerPerformance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suggestion: option to enforce case sensitive imports ... - GitHub
The reason for that is that Windows is case insensitive with regards to import paths where the MAC is case sensitive. Since we...
Read more >
Case-sensitive import statements in TypeScript
It turns out that import statements are case-insensitive on Mac and Windows but case-sensitive on Linux. There is a ...
Read more >
Case-sensitive import statements in TypeScript
It turns out that import statements are case-insensitive on Mac and Windows but case-sensitive on Linux. There is a ...
Read more >
TSConfig Reference - Docs on every TSConfig option
This allows the compiler to resolve relative module imports within these “virtual” directories, as if they were merged in to one directory. For...
Read more >
Support migration from a case-sensitive database (including ...
NOTE: This suggestion is for Confluence Cloud. Using Confluence Server? See the corresponding suggestion. Different databases have different settings for case ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found