Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Failed with "new UnhandledPromiseRejection(reason);" error

Aperta
#21 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript, node.js, react, vite
Ambito
cli, tooling

Direzione di ricerca

Riprodurre npx create-codeceptjs . --use-yarn in un progetto React Vite/SWC e ispezionare la configurazione dei pacchetti generata e l’output di Yarn postinstall, in particolare l’errore di Detox relativo a react-native. Il lavoro è completato quando l’installer termina per un semplice progetto web React senza il rifiuto non gestito né l’errore dovuto a una dipendenza React Native incompatibile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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!

Lingua principale
JavaScript
Stelle
15
Fork
12
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codeceptjs/create-codeceptjs

Tutte le issue di codeceptjs/create-codeceptjs

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.