LogBox code frames for console.error/warn showing wrong code
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, react-native
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bắt đầu với reproducer được liên kết và theo dõi cách Metro xử lý stack trace được dùng cho các code frame của LogBox, đồng thời so sánh dòng App.tsx được báo cáo với frame View được hiển thị. Công việc được hoàn thành khi các code frame của console.error và console.warn trỏ đến đúng các dòng mã nguồn thực tế trên iOS.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
It appears that in 0.73, code frames are broken, and point to the wrong line. This repos for me by creating an empty project with npx react-native@latest init project, and adding console.log to the top of App.tsx:
function App(): React.JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
};
// 🚩 new line
console.error('HIT');
return ( ... )
}
Expectation
The code frame should point to this line with console.error.
Actual
The code frame points to something inside of View:
Note: the 4th line in the stack trace is the correct line: App.tsx:65 is where the console.error is:
Steps to reproduce
- `npx react-native@latest init myproject.
- Update App.tsx with console.error.
- Obsever LogBox codeframe is incorrect.
React Native Version
0.73.0
Affected Platforms
Runtime - iOS
Output of npx react-native info
System:
OS: macOS 14.0
CPU: (8) arm64 Apple M2
Memory: 75.41 MB / 24.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.4.0
path: ~/.nvm/versions/node/v20.4.0/bin/node
Yarn:
version: 1.22.19
path: ~/.nvm/versions/node/v20.4.0/bin/yarn
npm:
version: 9.7.2
path: ~/.nvm/versions/node/v20.4.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.12.1
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.0
- iOS 17.0
- macOS 14.0
- tvOS 17.0
- watchOS 10.0
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode:
version: 15.0/15A240d
path: /usr/bin/xcodebuild
Languages:
Java: Not Found
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.0
wanted: 0.73.0
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Stacktrace or Logs
ERROR HIT
at App (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.seventhree:125259:54)
at RCTView
at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.seventhree:59687:43)
at RCTView
at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.seventhree:59687:43)
at AppContainer (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.seventhree:59529:36)
at seventhree(RootComponent) (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.seventhree:111251:28)
Reproducer
https://github.com/react-native-community/reproducer-react-native
Screenshots and Videos
Above
- Ngôn ngữ chính
- JavaScript
- Star
- 5.7k
- Fork
- 706
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 59
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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
-
constant-folding-plugin emits 0/0 (NaN) for arithmetic on destructured bindingsCó thể đã có người làm @cpruijsen đã nhận 14 ngày trước. Đang mở
Độ 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
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 35/100
react/metro#2062 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[0.83.x] Backport micromatch removal and dotfile/multipart watcher fix togetherCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`dependencies is not iterable` / `Cannot read property 'reduce' of undefined`: `FileStore` serves zero-prefixed cache files as hitsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
react/metro#1961 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
建议增加URL参数构建的工具Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
uoftblueprint/canada-basketball#67 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
打开群聊的设置同时打开侧边栏会出现侧边只出现一半Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 61/100
Fei2411/DeepSeek-Bot#456 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
área:app área:produto sem-fase tipo:decisão
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
Varanda-org/varanda#91 ·
-
0️⃣ phase/new
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày