cboulanger / zotero-sync-bookends

Bookends Store for https://github.com/retorquere/zotero-sync
7 stars 0 forks source link

TypeError #2

Closed joshuawagner closed 2 years ago

joshuawagner commented 2 years ago

Hi, I have set my environment variables and when I run npm test as instructed, I receive the following result:

> @cboulanger/zotero-sync-bookends@2.1.1 test
> tsc && npx ts-node test.ts

TypeError: Cannot read properties of undefined (reading '30')
    at Sync.login (/Users/josh/Documents/GitHub/zotero-sync-bookends/node_modules/@retorquere/zotero-sync/index.js:32:38)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at /Users/josh/Documents/GitHub/zotero-sync-bookends/test.ts:41:5

Can you help me troubleshoot this?

Also, I had bookends-api working on my previous versions of Zotero and Bookends. Is it possible that that still works with updated versions if I can't get this working?

cboulanger commented 2 years ago

Have you made sure that the API token has access to the group/library that you want to access? The line that throws the error accesses account.access.groups[library.id] from the json response of https://api.zotero.org/users/${account.userID}/groups, which in turn is retrieved from https://api.zotero.org/keys/current

Please visit https://api.zotero.org/keys/current?key=YOUR_API_KEY, then https://api.zotero.org/users/YOUR_ACCOUNT_ID/groups?key=YOUR_API_KEY to see if the API key allows the access to any group.

I don't know if https://github.com/cboulanger/bookends-api still works with the current version of Bookends, since I only have v13.4.1.

joshuawagner commented 2 years ago

Yep, you were right. I had something wrong in my Zotero permissions. Thank you. It's working!

cboulanger commented 2 years ago

Happy to hear it is working for you now.