Skip to content
This repository has been archived by the owner on Jan 16, 2020. It is now read-only.

UnhandledPromiseRejectionWarning messages #12

Closed
MarcWithercy opened this issue Dec 4, 2018 · 11 comments
Closed

UnhandledPromiseRejectionWarning messages #12

MarcWithercy opened this issue Dec 4, 2018 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@MarcWithercy
Copy link

Hi, Im trying to migrate my companies data/hours etc from Toggl to Clockify. Ive followed the instructions you provided but I get the following...

Fetching workspaces from Toggl...
(node:14678) UnhandledPromiseRejectionWarning: TypeError: Symbol.asyncIterator is not defined.
at __asyncGenerator (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:50:38)
at Toggl.getWorkspaceDetailsIteratable (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:387:16)
at Toggl. (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:463:49)
at step (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:43:23)
at Object.next (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:24:53)
at fulfilled (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:15:58)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:14678) 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:14678) [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.

Any ideas, please?

@mikerourke
Copy link
Owner

mikerourke commented Dec 4, 2018

@MarcWithercy Which version of Node are you using to perform the transfer?

@mikerourke
Copy link
Owner

You need to be on Node.js version 10.3 or greater. Older versions don't support async iteration. I'll add to the README and package.json files to prevent this going forward.

@mikerourke mikerourke added the bug Something isn't working label Dec 4, 2018
@mikerourke mikerourke self-assigned this Dec 4, 2018
@mikerourke
Copy link
Owner

FYI @MarcWithercy I added a check to ensure you're using the correct Node version. It's more of a band-aid for now (I could use a library or polyfill to limit the restriction). If you upgrade your version of Node.js, it should work fine. I recommend a tool like nvm.

@MarcWithercy
Copy link
Author

MarcWithercy commented Dec 5, 2018 via email

@MarcWithercy
Copy link
Author

MarcWithercy commented Dec 5, 2018 via email

@mikerourke
Copy link
Owner

I think I've seen this issue before. I want to say the issue was that the workspace name in the config file didn't match the one on Toggl (but I could be wrong). Unfortunately, the error handling isn't very robust right now, but I'm working on a significant update that transfers more entities and fixes some of the issues. I'm still hashing out the functionality though.

Just out of curiosity, are you transferring data for multiple users, or just you? If you're trying to do a multi-user load, it won't work (that's the update I'm currently working on per #7). If that's the case, I can ping you when I publish the new version. My goal is to have the update out by December 21st. It's a significant effort and I'm a little strapped for time at the moment.

@MarcWithercy
Copy link
Author

MarcWithercy commented Dec 5, 2018 via email

@mikerourke
Copy link
Owner

Thank you, that's very kind of you to say. I honestly did not expect this library to be so popular, I originally just cobbled it together as a one-off to transfer my Toggl data. The multi-user aspect of it adds an additional layer of complexity, plus having to accommodate for changes in two different APIs. I'll be sure to inform you as soon as the update is ready.

@sVathis
Copy link

sVathis commented Dec 14, 2018

I get a similar (albeit not the same) error message:
The error occurs while "Transferring clients" and has nothing to do with the async iterator.

Transferring clients to Clockify in Heater...
(node:16808) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'filter' of null
    at Clockify.<anonymous> (C:\Users\spiros\AppData\Roaming\npm\node_modules\toggl-to-clockify\lib\tools\Clockify.js:300:63)
    at step (C:\Users\spiros\AppData\Roaming\npm\node_modules\toggl-to-clockify\lib\tools\Clockify.js:43:23)
    at Object.next (C:\Users\spiros\AppData\Roaming\npm\node_modules\toggl-to-clockify\lib\tools\Clockify.js:24:53)
    at C:\Users\spiros\AppData\Roaming\npm\node_modules\toggl-to-clockify\lib\tools\Clockify.js:18:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\spiros\AppData\Roaming\npm\node_modules\toggl-to-clockify\lib\tools\Clockify.js:14:12)
    at Clockify.transferEntitiesFromToggl (C:\Users\spiros\AppData\Roaming\npm\node_modules\toggl-to-clockify\lib\tools\Clockify.js:293:16)
    at Clockify.<anonymous> (C:\Users\spiros\AppData\Roaming\npm\node_modules\toggl-to-clockify\lib\tools\Clockify.js:407:41)
    at step (C:\Users\spiros\AppData\Roaming\npm\node_modules\toggl-to-clockify\lib\tools\Clockify.js:43:23)
    at Object.next (C:\Users\spiros\AppData\Roaming\npm\node_modules\toggl-to-clockify\lib\tools\Clockify.js:24:53)
(node:16808) 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: 2)
(node:16808) [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.

I am not sure if this is the same case as above. Should I file a new bug for this?
I am on Node v10.14.2 transferring only personal projects.

@mikerourke
Copy link
Owner

mikerourke commented Dec 14, 2018

@sVathis Please file a new issue, I think this is an unrelated error and a relatively simple fix.

@mikerourke
Copy link
Owner

@MarcWithercy I know it's been awhile, but I'm planning on publishing a web-based version of the tool next week without all the annoying bugs. Would you like me to send you a link when it's ready?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants