Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Cannot read property 'type' of undefined #53

Closed
creatrixtiara opened this issue Oct 18, 2016 · 4 comments
Closed

Cannot read property 'type' of undefined #53

creatrixtiara opened this issue Oct 18, 2016 · 4 comments

Comments

@creatrixtiara
Copy link

I'm running into issues trying to sync my Todoist and Habitica via Terminal on Mac:

`/usr/local/lib/node_modules/todoist-habitrpg/habitSync.js:218
if(res.body.type == "daily") {
^

TypeError: Cannot read property 'type' of undefined
at /usr/local/lib/node_modules/todoist-habitrpg/habitSync.js:218:20
at fn (/usr/local/lib/node_modules/todoist-habitrpg/node_modules/async/lib/async.js:638:34)
at Immediate._onImmediate (/usr/local/lib/node_modules/todoist-habitrpg/node_modules/async/lib/async.js:554:34)
at processImmediate as _immediateCallback`

both the command itself and 'sudo' command aren't working.

@eringiglio
Copy link

unofficial fix: have found that if you go to /usr/local/lib/node_modules/todoist-habitrpg/habitSync.js, comment out lines 218-220 (the if(res.body.type) line from the error and the two lines immediately under it, and run it again, it'll work. thereafter it fixes the json fine and will have no issues afterwards.

not fluent enough in JS to fix it myself in the program per se, but that'll fix it without duplicating all your tasks. it seems to happen when someone completes a task in habitica before completing it in todoist, especially daily tasks.

@creatrixtiara
Copy link
Author

I can't seem to find that file on my Mac - I go to /usr/local and there's
no lib even. I'll try erasing the json file.

---
Tiara S. | Creatrix Tiara
Creative producer, media-maker, artist, writer, activist, organiser,
changemaker
signs up for anything that looks interesting.
http://creatrixtiara.com

CURRENTLY SEEKING WORK IN MELBOURNE OR REMOTE!
Contact me for any opportunities, gigs, jobs, and so on related to arts,
media, tech, education, community development, culture, or anything else
where I may be useful.

On 19 October 2016 at 05:51, Erin Giglio [email protected] wrote:

unofficial fix: have found that if you go to /usr/local/lib/node_modules/todoist-habitrpg/habitSync.js,
comment out lines 218-220 (the if(res.body.type) line from the error and
the two lines immediately under it, and run it again, it'll work.
thereafter it fixes the json fine and will have no issues afterwards.

not fluent enough in JS to fix it myself in the program per se, but
that'll fix it without duplicating all your tasks. it seems to happen when
someone completes a task in habitica before completing it in todoist,
especially daily tasks.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#53 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIFPO5WylbbHwtPsQBVWwV6YsVhxgMc9ks5q1RVGgaJpZM4KZUcQ
.

@eringiglio
Copy link

eringiglio commented Oct 19, 2016

Right, you have a mac! I've always run this thing on linux/cygwin systems. It might be a hidden file, or I might be wrong about the location on your system. There's got to be a node_modules folder with your npm modules SOMEWHERE on your file system, though; maybe try a search with hidden files checked for that folder?

@kusold
Copy link
Owner

kusold commented Nov 2, 2016

Dupe of #44.

I just pushed a stop gap measure ( version 1.0.1). It's not completely fixed, but the process should stop crashing. I'm going to leave #44 open until it is truly fixed, but I'll close this issue.

@kusold kusold closed this as completed Nov 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants