What caused my reference error?

When i try and run the program in the terminal it comes up with this :
(node:316) UnhandledPromiseRejectionWarning: Un
handled promise rejection (rejection id: 1): Re
ferenceError: resolveValue is not defined
(node:316) DeprecationWarning: Unhandled promis
e rejections are deprecated. In the future, pro
mise rejections that are not handled will termi
nate the Node.js process with a non-zero exit c
ode.

Can someone tell me how to stop this.

It looks like this is the main error: ReferenceError: resolveValue is not defined

I’m thinking you have a typo. My guess is that your handleSuccess function looks something like this:

function handleSuccess(resolvedValue) { //"resolved" with a "d"
  console.log(resolveValue); //"resolve" WITHOUT a "d" - typo
}

It should work if you use resolvedValue everywhere.

2 Likes