LogBox code frames for console.error/warn showing wrong code
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, react-native
- Área
- tooling
Línea de trabajo
Comienza con el reproductor enlazado y sigue el manejo que hace Metro del stack trace utilizado para los code frames de LogBox, comparando la línea reportada de App.tsx con el frame de View mostrado. Se considera terminado cuando los code frames de console.error y console.warn apunten a sus líneas de origen reales en iOS.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- JavaScript
- Estrellas
- 5.6k
- Forks
- 702
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 59
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de react/metro
-
constant-folding-plugin emits 0/0 (NaN) for arithmetic on destructured bindingsPosiblemente ocupada @cpruijsen la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
react/metro#1927 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 1-2 días Aptitud para principiantes 35/100
react/metro#2062 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[0.83.x] Backport micromatch removal and dotfile/multipart watcher fix togetherPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
`dependencies is not iterable` / `Cannot read property 'reduce' of undefined`: `FileStore` serves zero-prefixed cache files as hitsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
react/metro#1961 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de react/metro
Issues similares
-
[APP/MODULE]Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
awesome-android-root/awesome-android-root#195 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
subhranshudash13-dotcom/Contribo#74 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
qq15725/modern-screenshot#174 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 67/100
ThatGuySam/doesitarm#1114 ·