auchenberg / auchenberg/node-personal-capital
I can't get the example to work
- Dominant language
- TypeScript
- Stars
- 8
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
I get this error when I try to run it
```
johnaron@JOHNARON-M-841U:TradeTracker3$ node .
/Users/johnaron/git/DIY_Trading_Advisor/TradeTracker3/node_modules/tough-cookie-file-store/lib/cookie-file-store.js:334
dataJson[domainName][pathName][cookieName] = Cookie.fromJSON(
^
TypeError: Cannot assign to read only property '0' of string '_insights'
at FileCookieStore._loadFromFile (/Users/johnaron/git/DIY_Trading_Advisor/TradeTracker3/node_modules/tough-cookie-file-store/lib/cookie-file-store.js:334:54)
at new FileCookieStore (/Users/johnaron/git/DIY_Trading_Advisor/TradeTracker3/node_modules/tough-cookie-file-store/lib/cookie-file-store.js:31:10)
at new PersonalCapital (/Users/johnaron/git/DIY_Trading_Advisor/TradeTracker3/node_modules/personal-capital-sdk/dist/index.js:17:55)
at Object. (/Users/johnaron/git/DIY_Trading_Advisor/TradeTracker3/index.js:3:10)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
```
I think its because my cookies.json file is not in the right format. I have a flat list of cookies in json format and I think the parser is expecting nested cookies under a domain and path. I used a chrome extension called "Export cookie JSON file for Puppeteer" to get the cookies after I logged in to PC. How did you get your cookies?
John
[pc-cookie2.json.txt](https://github.com/auchenberg/node-personal-capital/files/5751745/pc-cookie2.json.txt)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with index.js and the stack trace through personal-capital-sdk/dist/index.js and tough-cookie-file-store/lib/cookie-file-store.js. Compare the attached pc-cookie2.json.txt with the cookie structure the example expects, then verify that running node . no longer produces the reported TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100