Questions tagged [unhandled-promise-rejection]

84 questions
1
vote
0 answers

Unhandled promise rejection: TypeError: (0, _context2.t0) is not a function. (In '(0, _context2.t0 )(_context2.t1)', '(0, _context2.t0)' is undefined)

I am using expo go and react native to create an app to handle storage for products. I am trying to set a products stock in an API by name, id and stock by the method PUT. I can set the order but whatever I am stuck at the product update. I get this…
1
vote
2 answers

Possible unhandled promise rejection (id: 0)

I've been having this problem for over a month now, this error occurs whenever I try to login to my react-native app using a mobile device. This is the error And this is the code to login in my react native app
Chuuubs
  • 11
  • 2
1
vote
1 answer

What is UnhandledPromiseRejectionWarning: Error?

I've pasted two almost same codes with one little difference, one works just fine but the other gives UnhandledPromiseRejectionWarning. async function promise () { return new Promise((resolve, reject) => { throw new Error(); resolve(); …
1
vote
1 answer

Handling Unhandled promise rejection in express application

I have an existing Node Express Application and want to improve the error handling better. My current route endpoint definition is like below, app.get('/example/getActiveId', async (req, res, next) => { // Some code to fetch some details from…
1
vote
3 answers

Axios & Typescript promise rejection error has type unkown

The problem I'm currently facing is that I can't use a returned error from a promise rejection because it is not typeable with Typescript. For example when a signup request fails because the username is already taken I return a 400 with the message…
JonasLevin
  • 1,592
  • 1
  • 20
  • 50
1
vote
2 answers

Mongoose: Unhandled promise rejection

I know there are other posts with similar issues, but none of the suggestions I've tried have worked. The following works if the _id is valid, but throws an unhandled promise rejection error if it isn't: const Movie = mongoose.model(`Movie`,…
1
vote
0 answers

Safely remove a USB device using a powershell script

I have to safely remove a USB device using a powershell script. Therefore I use following lines: $drive= New-Object -comObject Shell.Application $drive.Namespace(17).ParseName().InvokeVerb("Eject") The good thing is that Windows…
PhilPro
  • 11
  • 2
1
vote
1 answer

How to fix an unhandledpromiserejection in repl.it. The error I had said "cannot read the property of q"

I was following a tutorial YT here's the link https://www.youtube.com/watch?v=7rU_KyudGBY&t=726s to create a discord bot. But I have an error that I can't figure out how to fix. It says "cannot read the property of q". The only q I have in my code…
Ethan Agar
  • 92
  • 9
1
vote
1 answer

Why does Promise.all() throw an exception even if I .catch() it?

Running the code Promise.all(new Promise((res, rej) => rej('Failure!'))) .catch(() => console.log("It's all okay.")) in Node v12.19.0 logs It's all okay. to the console but still throws an exception. Why is that? I would have expected the same…
1
vote
1 answer

How could I fix this error promise error?

If I let several minutes go by without answering I get this error: (node:14012) UnhandledPromiseRejectionWarning: # (node:14012) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an…
1
vote
0 answers

UnhandledPromiseRejectionWarning Discord bot

I'm trying to create my own discord bot to learn more code and to make features for my server. I've been following this tutorial on how to get started but when I run the nodemon --inspect index.js, I get this message and it doesn't work as intended…
1
vote
2 answers

Dropbox's `filesGetTemporaryLink` throws an uncatchable `UnhandledPromiseRejectionWarning` and terminates Node.js

To get a download link to the file hosted on Dropbox, I'm using a Dropbox JavaScript API (7.0.0): export const fileDownload = async function fileDownload(fileUUID) { let isSucceeded; let message; let file; const dbx =…
Mike
  • 14,010
  • 29
  • 101
  • 161
1
vote
2 answers

nhandledPromiseRejectionWarning: ValidationError: user validation failed: password: Path `password` is required

I'm trying to register users using node and mongo but I get this ValidationError: unhandledPromiseRejectionWarning: ValidationError: user validation failed: password: Path password is required., username: Path username is required., email: Path…
Amine
  • 57
  • 7
0
votes
1 answer

Object is of type 'unknown' typescript

I have a createAsyncThunk function. With status 401, I create a new error through the constructor and throw this error. In catch, why can't I get her message field? -> 'err' is of type 'unknown'.ts(18046) export const add = createAsyncThunk
0
votes
1 answer

Unhandled Promise Rejection: NotSupportedError (and) Failed to load because no supported source was found

I am creating a website and I would like to be able to play audio on various browsers. I am getting the two errors above on Safari and Chrome respectively on my deployed site, but audio plays fine locally. Here are the full errors: (Safari)Unhandled…