Questions tagged [unhandled-promise-rejection]

84 questions
0
votes
2 answers

How to cover the await by try...catch blocks nicely?

This code is ugly, isn't it? import axios from 'axios'; async function f1() { try { const resp = await axios.get('http://www.randomnumberapi.com/api/v1.0/randomnumber'); return resp.data[0]; } catch (err) { throw err; } } async…
0
votes
0 answers

I keep getting UnhandledPromiseRejection trying to use couchimport

whenever i try to import data int othe database using : cat ./reviews.json | couchimport --type "json" --jsonpath "reviews.*" --database reviews I get this error : node:internal/process/promises:288 triggerUncaughtException(err, true /*…
0
votes
0 answers

Node version 16 test cases causing error unhandled rejection in github actions deployment

Have upgraded node version from 10 to 16 in the application and handled all unhandled promise rejection in the unit test cases (TDD) and all test cases passing in local environment. But while deploying in the github actions facing error for…
0
votes
0 answers

Expo unable to call remote API from react native app

I have a react native app on a local machine which is to call an API from another local machine on the same networ with a fetch() method. But I keep getting this error "Possible Unhandled Promise Rejected(id:0)" TypeError: Network request…
0
votes
0 answers

unhandled promise rejection when running whatsapp bot

I'm running a whatsapp bot and everything works fine until I get a message at /root/bot/node_modules/@adiwajshing/baileys/lib/Utils/generics.js:157:32 (node:26706) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated…
0
votes
1 answer

TypeError: Cannot read properties of undefined in the conversion app how to resolve it

Upon running following statement it's showing this following error in the console tab Command Running in the Console convert(100, 'CAD', 'USD') Error showing in the console after running the above conversion statment request `Paused on promise…
0
votes
2 answers

Uncaught promise with createReadStream

I have a basic code reading from a file, and I want to handle errors such as not being able to open the file. Here's what my code looks like: async function processFile() { const fileStream = fs.createReadStream(source); fileStream.on('error',…
user1319182
  • 481
  • 12
  • 26
0
votes
1 answer

redux-toolkit fetch many data in createAsyncThunk

I need function in redux-toolkit to fetch all data from others slices. I have this code: export const getAllData = createAsyncThunk( 'fetchRoot/getAllData', async (_, { dispatch, rejectWithValue }) => { const promises =…
0
votes
1 answer

How to handle this promise.all case?

We have a parallel promise call:- promise.all([p1,p2]).then().catch() here p1,p2 are 2 different promise calls . p1 - reject for some condition and show e1 p2 - reject for some condition and show e2 p1 - resolve then do something p2 - do not…
0
votes
0 answers

(node:1928) UnhandledPromiseRejectionWarning: MongooseError: Operation `users.createIndex()` buffering timed out

Getting the following error when I tried to estalish connection to my MongoDB Atlas. [nodemon] starting `node index.js` Note-It backend listening at http://localhost:5000 (node:1928) UnhandledPromiseRejectionWarning: MongooseError: Operation…
0
votes
1 answer

Error being displayed while setting up react native development environment

After typing 'npm start' instead of getting QR code on the terminal I am getting a 'UnhandledPromiseRejectionWarning' error. Can please someone help me resolve this? I am a beginner at this so I dont know the meaning of errors being…
0
votes
1 answer

Why does "unhandledrejection" event not fire from the file:// protocol?

Consider the following example: var prom1 = new Promise(function(resolve, reject) { setTimeout(function() { console.log("Promise executed"); reject("Rejected"); }, 2000); }); console.log("Before Promise"); var test =…
user31782
  • 7,087
  • 14
  • 68
  • 143
0
votes
2 answers

Rejection because of unhandled promise in Node Js

Hope you are all doing fine! I am running with some difficulties when I want to deploy this api. I keep on receiving the message:"UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an…
0
votes
0 answers

UnhandledPromiseRejection when a promise is rejected and added to an array of promises

I have the promise in function2 which is rejected and added into the array of promises in function1. The code ends with UnhandledPromiseRejection. Can you please help me to understand why the promise is not successfully returned from function1 and…
Jaroslav
  • 19
  • 4
0
votes
1 answer

Target sdk 30 and All File Access permission

My app is rejected due to All file access permission but our app needs it without that it won't work out. we are not able to upload app with target sdk 30 or 31 and All File Access permission?