Expo调试断点错位求助:断点命中位置偏移两行
Expo项目Chrome调试器断点偏移问题
- 此前开发React Native裸项目调试正常,切换到Expo后,Chrome调试器的断点总是命中设置行下方两行的位置,仅Expo项目出现该问题。
- 使用设备:苹果M2芯片的MacBook Pro
- 已测试场景:Brave、Chrome、Firefox浏览器,覆盖Android、iOS平台,以及tsx、jsx类型的初始化项目
- 项目初始化步骤:
npx create-expo-app test cd test && npx expo prebuild npx expo run:android
测试代码如下:
import { StatusBar } from "expo-status-bar"; import { Button, StyleSheet, Text, View } from "react-native"; const test = () => { console.log("Test1"); // <- breakpoint console.log("Test2"); // <- breakpoint console.log("Test3"); // <- breakpoint }; export default function App() { return ( <View style={styles.container}> <Text>Open up App.js to start working on your app!</Text> <StatusBar style="auto" /> <Button title="click" onPress={() => test()} /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: "#fff", alignItems: "center", justifyContent: "center", }, });
有视频演示该问题的具体情况。
请问有人知道问题所在吗?
内容的提问来源于stack exchange,提问作者matusalem
相关产品推荐
相关产品推荐

