`dependencies is not iterable` / `Cannot read property 'reduce' of undefined`: `FileStore` serves zero-prefixed cache files as hits
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- build-system
Hướng nghiên cứu
Start with FileStore.get and Transformer.transformFile, which the report identifies as the cache-read and transform entry points. Trace how zero-prefixed files become cache hits and review the related cache or transform tests. Done means an invalid cached transform is treated as a miss and replaced, without the reported dependencies error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This is a transform cache bug with a reliable reproduction on Windows NTFS in particular.
FileStore.get returns any file starting with a null byte as a Buffer (that's how set marks Buffer values), so a zero-prefixed cache file is a truthy hit. Transformer.transformFile uses it without validating content, and the build fails with dependencies is not iterable (Cannot read property 'reduce' of undefined on older versions) until the cache is cleared.
This is a symptom of power loss on NTFS - the file length is journalled but the data isn't flushed, so a subsequent read comes back full of nulls (e.g. https://github.com/coollabsio/jean/issues/679). That fits the reports, all on Windows:
- https://github.com/expo/create-react-native-app/issues/931 - fixed by deleting
%TEMP%(where the default cache lives), including after a BSOD - https://github.com/react/metro/issues/706
- https://github.com/expo/expo/issues/41876
- https://github.com/CryceTruly/truly-contacts-youtube/issues/2
We should treat a cached value that isn't a valid transform result as a miss, and overwrite it.
- Ngôn ngữ chính
- JavaScript
- Star
- 5.6k
- Fork
- 696
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 28
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của react/metro
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
react/metro#1927 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Async chunk URLs drop the file extension, so .cjs async imports fail with "Requiring unknown module"Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
react/metro#1959 · 2 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Please support Yarn PnPĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
react/metro#1928 · 2 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
react/metro#1915 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
refactor
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 5 ngày
-
translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ciderapp/translations#87 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
component: split-view platform: windows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
zen-browser/desktop#15616 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày