Failed with "new UnhandledPromiseRejection(reason);" error
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, node.js, react, vite
Línea de trabajo
Reproduce npx create-codeceptjs . --use-yarn en un proyecto React de Vite/SWC e inspecciona la configuración de paquetes generada y la salida de Yarn postinstall, especialmente el error de Detox relacionado con react-native. Se considera terminado cuando el instalador se completa para un proyecto web React simple sin el rechazo no gestionado ni el error por una dependencia de React Native incompatible.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I am using npx create-codeceptjs . --use-yarn in a React project created with Vite using SWC. I had barely added a couple of dependencies. After that I ran the aforementioned code and I received the following error:
➤ YN0000: └ Completed in 29s 664ms
➤ YN0000: · Failed with errors in 1m 5s
node:internal/process/promises:389
new UnhandledPromiseRejection(reason);
^
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".
at throwUnhandledRejectionsMode (node:internal/process/promises:389:7)
at processPromiseRejections (node:internal/process/promises:470:17)
at process.processTicksAndRejections (node:internal/process/task_queues:96:32) {
code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v20.17.0
The log contains the following:
# This file contains the result of Yarn building a package (detox@virtual:b9d026221b6ccf869e6d11f2b48ce0b8c57b8019f0c9d219cace198e95e746647dd8655694a089c347671f2cf32e0f278e26b7a94b2cc75061efff0c4e6ae31b#npm:20.18.1)
# Script name: postinstall
/Users/acyment/dev/cyment-timer/.pnp.cjs:19551
Error.captureStackTrace(firstError);
^
Error: detox tried to access react-native, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: react-native (via "react-native/package.json")
Required by: detox@virtual:b9d026221b6ccf869e6d11f2b48ce0b8c57b8019f0c9d219cace198e95e746647dd8655694a089c347671f2cf32e0f278e26b7a94b2cc75061efff0c4e6ae31b#npm:20.18.1 (via /Users/acyment/dev/cyment-timer/.yarn/unplugged/detox-virtual-4250b31ea8/node_modules/detox/src/utils/rn-consts/)
Require stack:
- /Users/acyment/dev/cyment-timer/.yarn/unplugged/detox-virtual-4250b31ea8/node_modules/detox/src/utils/rn-consts/rn-consts.js
- /Users/acyment/dev/cyment-timer/.yarn/unplugged/detox-virtual-4250b31ea8/node_modules/detox/scripts/updateGradle.js
- /Users/acyment/dev/cyment-timer/.yarn/unplugged/detox-virtual-4250b31ea8/node_modules/detox/scripts/postinstall.js
at require$$0.Module._resolveFilename (/Users/acyment/dev/cyment-timer/.pnp.cjs:19551:13)
at Module._load (node:internal/modules/cjs/loader:1051:27)
at require$$0.Module._load (/Users/acyment/dev/cyment-timer/.pnp.cjs:19442:31)
at Module.require (node:internal/modules/cjs/loader:1311:19)
at require (node:internal/modules/helpers:179:18)
at parseRNVersion (/Users/acyment/dev/cyment-timer/.yarn/unplugged/detox-virtual-4250b31ea8/node_modules/detox/src/utils/rn-consts/rn-consts.js:2:23)
at Object.<anonymous> (/Users/acyment/dev/cyment-timer/.yarn/unplugged/detox-virtual-4250b31ea8/node_modules/detox/src/utils/rn-consts/rn-consts.js:11:3)
at Module._compile (node:internal/modules/cjs/loader:1469:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
at require$$0.Module._extensions..js (/Users/acyment/dev/cyment-timer/.pnp.cjs:19594:33)
Node.js v20.17.0
I will be using plain React for web, not react native
Thanks!
- Lenguaje dominante
- JavaScript
- Estrellas
- 15
- Forks
- 12
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 codeceptjs/create-codeceptjs
-
Add support for pnpm Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 20/100