Fantom's runCommandSync throws a TypeError for a command that cannot start, instead of returning its ENOENT error
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
Línea de trabajo
Empieza en private/react-native-fantom/runner/utils.js, especialmente en runCommandSync alrededor de las líneas 257–258, y revisa las pruebas del runner en private/react-native-fantom/runner/__tests__/. Ejecuta el reproductor proporcionado para el caso de un comando inexistente o añade ese caso a la prueba correspondiente. El trabajo está listo cuando un comando que no puede iniciarse devuelve un error ENOENT con stdout vacío, mientras que un comando que se ejecuta sigue devolviendo su salida.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
runCommandSync in private/react-native-fantom/runner/utils.js returns stdout: result.stdout.toString() (L257), while stderr on the next line reads result.stderr?.toString() ?? '' (L258). When spawnSync cannot start the command, result.stdout is undefined, so runCommandSync throws TypeError: Cannot read properties of undefined (reading 'toString') and never returns the result whose error is spawnSync <command> ENOENT.
runBuck2Sync goes through it (L328), so where buck2 is missing, the tester and Hermes compiler builds throw this TypeError before reaching their throw new Error(getDebugInfoFromCommandResult(result)) (tester.js L85, hermesc.js L73). The same goes for a missing hermesc binary (hermesc.js L119).
Steps to reproduce
- In a checkout of
main(9a4ef4d7984) afteryarn install, putrunCommandSyncMissingCommand-test.jsfrom the reproducer below inprivate/react-native-fantom/runner/__tests__/and runyarn jest private/react-native-fantom/runner/__tests__/runCommandSyncMissingCommand-test.js; or runnode repro.cjs <path to the checkout>from the reproducer, which copies that test in, runs it, removes it, and exits 1 while the defect shows.
runCommandSync('fantom-command-that-does-not-exist', [], {});
Expected: it returns a result whose error.code is ENOENT and whose stdout is '', so getDebugInfoFromCommandResult reports the spawn error; a command that runs still returns its output.
Actual: it throws TypeError: Cannot read properties of undefined (reading 'toString') at utils.js:257.
React Native Version
main at 9a4ef4d7984 (nightly)
Affected Platforms
Build - Windows
Output of npx @react-native-community/cli info
Not applicable: this is Fantom's runner in React Native's own repository. The reproducer's run:
react-native 9a4ef4d7984 (2026-11-16), Windows_NT 10.0.26300, node v26.12.1
Stacktrace or Logs
react-native 9a4ef4d7984 (2026-11-16), Windows_NT 10.0.26300, node v26.12.1
private/react-native-fantom/runner/utils.js:257: stdout: result.stdout.toString(),
private/react-native-fantom/runner/utils.js:258: stderr: result.stderr?.toString() ?? '',
copied runCommandSyncMissingCommand-test.js to private/react-native-fantom/runner/__tests__/
$ yarn jest private/react-native-fantom/runner/__tests__/runCommandSyncMissingCommand-test.js
removed private/react-native-fantom/runner/__tests__/runCommandSyncMissingCommand-test.js
jest exited 1
failed: reports a command that cannot start through its result
passed: returns the output of a command that runs
runCommandSync('fantom-command-that-does-not-exist', [], {}): threw TypeError: Cannot read properties of undefined (reading 'toString')
at toString (private\react-native-fantom\runner\utils.js:257:27)
runCommandSync(node, ['-e', 'process.stdout.write("ok")'], {}): returned status 0, error null, stdout "ok"
SUMMARY: runCommandSync('fantom-command-that-does-not-exist', [], {}) throws "TypeError: Cannot read properties of undefined (reading 'toString')" instead of returning the ENOENT spawn error; expected a result with error.code ENOENT and stdout ''
MANDATORY Reproducer
https://github.com/YevheniiKotyrlo/rn-fantom-run-command-sync-repro — node repro.cjs <path to a react-native checkout> exits 1 while runCommandSync throws for a command that cannot start, and 0 once it returns the ENOENT error with stdout ''.
Screenshots and Videos
No response
- Lenguaje dominante
- C++
- Estrellas
- 127k
- Forks
- 25.5k
- Merge medio
- 3 d 22 h
- PR fusionados (30 d)
- 235
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/react-native
-
Needs: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
react/react-native#60000 ·
Los mantenedores suelen responder en 2 días
-
`yarn test-ios` exits before building RNTester: `objc-test.sh` launches the WebSocket server script #59433 deletedPosiblemente ocupada @lazerg la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
react/react-native#59939 ·
Los mantenedores suelen responder en 2 días
-
iOS Fabric pointer-handler reset leaves the next lone touch non-primaryPosiblemente ocupada @alleneubank la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
react/react-native#59919 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
react/react-native#59722 ·
Los mantenedores suelen responder en 2 días
-
Android: new WebSocket() crashes the app for a URL that OkHttp or java.net.URI rejectsPosiblemente ocupada @sorinc03 la tomó hace 14 días. Abierto🌐Networking Needs: Author Feedback Needs: Repro Platform: Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
react/react-native#59704 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de react/react-native
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
petercorke/robotics-toolbox-python#943 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area:build bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
NatronGitHub/openfx-arena#71 ·
Los mantenedores suelen responder en 1 día
-
upstream-blocked
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ROCm/FastFlowLM#1057 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
NatronGitHub/openfx-gmic#45 ·
Los mantenedores suelen responder en 1 día