Questions tagged [unhandled-promise-rejection]

84 questions
0
votes
1 answer

(node:44564) UnhandledPromiseRejectionWarning: TypeError: client.on is not a function

I'm currently making a discord bot with a multitude of different commands and after implementing a ?beg and a ?bal command to beg for my imaginary currency called 'bits', it seemed to break a-lot of code. I was able to fix everything except one…
user15011471
0
votes
2 answers

How can I add a contact to a list/audience in Mailchimp using its own library via Node JS

The code below is the API call to add a contact to a list/audience programmatically using Node JS and the Mailchimp library. Documentation is found on:…
0
votes
0 answers

Unhandled Promise Rejection: undefined is not an object (evaluating 'result.queryResult.fulfillmentMessages')

Whenever I send a message on my React Native App, I receive this error: Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'result.queryResult.fulfillmentMessages') at…
0
votes
0 answers

(node:2136) UnhandledPromiseRejectionWarning: TypeError: browser

When try to run this url page this is the error i keep getting. Please Advice. (node:2136) UnhandledPromiseRejectionWarning: TypeError: browser.newpage is not a function at createPage (C:\Users\xolas\Downloads\Bot development\bot.js:7:32) at…
0
votes
1 answer

Cannot handle Unhandled Promise Rejection using try-catch

Hi I just downloaded ytdl-core module and I am encountering a Promise Rejection which I cannot handle! Can anyone please help? app.get("/getaudio", async (req, res) => { const videoID = req.query.v; const quality = req.query.q; try { …
0
votes
3 answers

NodeJS/DiscordJS UnhandledPromiseRejectionWarning Error

First of all, I'm pretty new to programming. Apologies if this post sounds naive. I'm making a Discord bot using JS, and using a command and event handler instead of everything in main.js. The error occurs when I issue the command…
0
votes
2 answers

Why does delaying handling of promise rejections sometimes result in UnhandledPromiseRejectionWarning?

When I run the following code, why do I get unhandled promise rejection warning? async function load() { throw new Error('error'); } async function main() { const promise = load(); await new Promise(resolve => setTimeout(resolve, 5000)); …
0
votes
1 answer

UnhandledPromiseRejectionWarning: DiscordjsError: Request to use token, but token was unavailable to the client

Hey im making a leaderboard command with discord-xp but when i run the command it gives the following error: (node:7400) UnhandledPromiseRejectionWarning: DiscordjsError: Request to use token, but token was unavailable to the client. at…
0
votes
2 answers

Unhandled Promise Rejection caused by my resolver: Typegoose, Type-Graphql

I keep getting an unhandled promise rejection error from my server as soon as I add any code to a specific resolver of mine used to query and mutate data in MongoDB. The code for the resolver is as shown: import { Coordinates, Fridge, Fridges } from…
0
votes
0 answers

Workaround for Unhandled promise rejection when awaiting later

When using async await, sometimes we want to hold the promise in a variable, do something else, and then await it later. If the "something else" doesn't take very long this works fine: try { const pWillReject = rejectAfter(8000); const someValue…
DJL
  • 2,060
  • 3
  • 20
  • 39
0
votes
1 answer

my app was working good but now shows the error [Unhandled promise rejection: TypeError: Invalid attempt to spread non-iterable instance

enter image description hereand the source error is located in node_modules/Libraries/LogBox/Data/LogBoxData.js I don't now how to fix it the code /LogBoxData.js export function addLog(log: LogData): void { const errorForStackTrace = new…
0
votes
1 answer

Unhandle promise rejection, getting data from API

export class Diet extends Component { constructor(props) { super(props); this.state = { data: [], }; } updateSearch = (e) => { axios .get( …
user13132748
0
votes
2 answers

UnhandledPromiseRejection despite catching expection

In the following code // file: main.js class A { async start() { throw 'error'; } } module.exports = A; // file index.js var r = require('./main.js'); let v = new r(); …
0
votes
1 answer

localStorage functions not working, getting a set headers error

localStorage.setItem('auth-token', ''); This line is where the suspected error is happening. I have read other questions that receive this error that I am going to post below. I have seen it commonly where there needs to be an async or an await…
0
votes
2 answers

react-native-network-info 'null is not an object'

It does not matter which function of the react-native-network-info I use, I always get a warning ([Unhandled promise rejection: TypeError: null is not an object (evaluating 'RNNetworkInfo.getGatewayIPAddress')]) and the function does not return…
NKurzweil
  • 3
  • 3