facebook / facebook/flow

Case sensitivity mismatch leads to "Required module not found" errors

Đang mở
#3,125 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug Windows support
Ngôn ngữ chính
Rust
Star
22.3k
Fork
1.9k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

This is related to #2117 but was a lot more of a pain to debug, as the errors it results in provide no clue that it's a case sensitivity issue.

One day out of nowhere I was suddenly getting hundreds of `Required module not found` errors when running a flow check, both on third party modules and import references to my own code. Tried reinstalling all npm modules etc with no luck.

```
navigation/RootNavigation.js:8
8: } from 'react-native'
^^^^^^^^^^^^^^ react-native. Required module not found

navigation/RootNavigation.js:22
22: import Colors from '../constants/Colors'
^^^^^^^^^^^^^^^^^^^^^ ../constants/Colors. Required module not found
```

Turns out I'd just happened to `cd` to the path of the project lazily using lowercase paths (works fine in the git bash in Windows 10), when there are a couple of uppercase letters in the real path. Unlike the examples in #2117 , I wasn't even getting a client/server mismatch error, as my first time running the server was from the lazily-cased path.

Flow simply refusing to type check and erroring out with a message that the current path is incorrect (similar to the referenced issue) would obviously be preferable to a load of errors about module resolution, which are a bit of a red herring as they only mention relative paths.

Appears in 0.33.0 and 0.37.4 (latest).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.