Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing argument produced UnhandledPromise Error #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DNU-bennett
Copy link

@DNU-bennett DNU-bennett commented Sep 21, 2019

On the first test run after install, I encountered an error:

$ npm run test-plaid

> build-your-own-mint@ test-plaid /home/chrx/repos/build-your-own-mint
> node scripts/testPlaid.js

(node:6476) UnhandledPromiseRejectionWarning: ReferenceError: category is not defined
    at /home/chrx/repos/build-your-own-mint/lib/fetch.js:46:7
    at Array.map (<anonymous>)
    at /home/chrx/repos/build-your-own-mint/lib/fetch.js:41:36
    at Array.reduce (<anonymous>)
    at exports.fetchTransactions (/home/chrx/repos/build-your-own-mint/lib/fetch.js:40:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /home/chrx/repos/build-your-own-mint/scripts/testPlaid.js:8:15
(node:6476) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 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(). (rejection id: 1)
(node:6476) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Removed the category argument from the function, which was also causing issues on updateSheet(), and now it works.

$ npm run test-plaid

> build-your-own-mint@ test-plaid /home/chrx/repos/build-your-own-mint
> node scripts/testPlaid.js

Transactions fetch successful!
[
  {
    ---MY TRANSACTIONS DATA--
  }
]

@dustinromey
Copy link

Had the same issue, these changes resolved it for me as well.

@philipheindel
Copy link

I also had this issue, and this has fixed it.

@@ -43,7 +43,6 @@ exports.fetchTransactions = async function() {
name,
date,
amount: -amount,
category,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option to add category to list of the map arguments on line 41

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #17

@bennett39
Copy link

This issue is resolved better in #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants