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

node fails with type error #1

Open
vrl2 opened this issue Jun 9, 2018 · 9 comments
Open

node fails with type error #1

vrl2 opened this issue Jun 9, 2018 · 9 comments

Comments

@vrl2
Copy link

vrl2 commented Jun 9, 2018

Hello,

Thanks for creating this tool! I'm new to Node.JS, and there might be an easy workaround for this. It installs fine with npm install, but when I try to run it, I get this error. Running it on Mac OS High Sierra - happy to provide any more details that would help me run it. Thanks!

$ node main > 'output.xml'

/Users/venkat/Desktop/hangouts-converter-master/Hangouts.js:290
data['conversation_state'].forEach(function(conversation) {
^

TypeError: Cannot read property 'forEach' of undefined
at new Hangouts (/Users/venkat/Desktop/hangouts-converter-master/Hangouts.js:290:30)
at Object. (/Users/venkat/Desktop/hangouts-converter-master/main.js:6:29)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)
at startup (internal/bootstrap/node.js:228:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:575:3)

@nvonbulow
Copy link
Owner

I suspect your Hangouts.json file might be empty. Just a reminder that the Hangouts.json file goes in the same directory as main.js. I would also recommend using the develop branch since that rewrite includes support for images (only as a hyperlink at this point).

@vrl2
Copy link
Author

vrl2 commented Jun 9, 2018

Thanks for getting back to me. Hangouts.json is 189M. I double checked that it is in the same directory as main.js, and I get the same errors whether I'm using the develop branch or the master branch.

@nvonbulow
Copy link
Owner

Can you download the utility jq and post the output of jq 'keys' -r Hangouts.json?

@Birdehub
Copy link

I am getting a similar issue. My Hangouts.json file is 222,300 KB large, if that helps

Output:
\hangouts-converter-master\Hangouts.js:290
data['conversation_state'].forEach(function(conversation) {
^

TypeError: Cannot read property 'forEach' of undefined
at new Hangouts (\hangouts-converter-master\Hangouts.js:290:30)
at Object. (\hangouts-converter-master\main.js:6:29)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at startup (internal/bootstrap/node.js:238:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3)

I downloaded jq. Here is the output

\hangouts-converter-master>jq-win64 keys -r Hangouts.json
[
"conversations"
]

@nvonbulow
Copy link
Owner

@Birdehub thanks for the info. It looks like my Hangouts.json file format is different from yours. Google may have changed the file format since I wrote this utility over a year ago. I'll see if I can get an updated version of my data and test with that

@vrl2
Copy link
Author

vrl2 commented Jun 17, 2018

Thanks for looking into it! In case it helps, my output from JQ is the same as @Birdehub:
$ jq 'keys' -r Hangouts.json
[
"conversations"
]

@Birdehub
Copy link

@nvonbulow Just curious if you have the free time to explore this? If not, I understand, just wanted to know if I should search for other solutions. Appreciate the responsiveness and time!

@nvonbulow
Copy link
Owner

@Birdehub I do have limited free time, but I should be able to create a fix by the end of the next weekend, maybe earlier

@nvonbulow
Copy link
Owner

@Birdehub @vrl2 sorry I haven't gotten back to you two yet. I've been very busy getting ready for and with school the past several months. It looks like the file format change is very significant, and I just haven't had the time to rewrite the program at all.

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

No branches or pull requests

3 participants