Failed with "new UnhandledPromiseRejection(reason);" error
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- javascript, node.js, react, vite
Rechercherichtung
Reproduziere npx create-codeceptjs . --use-yarn in einem Vite/SWC-React-Projekt und untersuche die erzeugte Paketkonfiguration sowie die Ausgabe von Yarn postinstall, insbesondere den Detox-Fehler zu react-native. Als erledigt gilt dies, wenn das Installationsprogramm für ein einfaches React-Webprojekt ohne die unbehandelte Ablehnung oder den Fehler aufgrund einer inkompatiblen React-Native-Abhängigkeit abgeschlossen wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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!
- Vorherrschende Sprache
- JavaScript
- Sterne
- 15
- Forks
- 12
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus codeceptjs/create-codeceptjs
-
Add support for pnpm Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 20/100
Alle Issues in codeceptjs/create-codeceptjs
Ähnliche Issues
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Improve Title Support Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·