Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON-RPC: "[error: Zotero.PDFRenderer is undefined" #3143

Open
bassio opened this issue Jan 29, 2025 · 2 comments
Open

JSON-RPC: "[error: Zotero.PDFRenderer is undefined" #3143

bassio opened this issue Jan 29, 2025 · 2 comments

Comments

@bassio
Copy link
Contributor

bassio commented Jan 29, 2025

Debug log ID

ZVC8WEV6-refs-apse/7.0.5

What happened?

Hello retorquere,

I access json rpc for the "attachments" function.

It gives me this error.

(3)(+0000002): {error: better-bibtex: <7.0.5 2IVYNMM8>} JSON-RPC: "[error: Zotero.PDFRenderer is undefined\nattachments@jar

It goes like this.

(3)(+0000002): Loaded collections in ENT in 12 ms

(3)(+0000001): Loading relations for 1 item in ENT

(4)(+0000001): SELECT itemID, predicate, object FROM items LEFT JOIN itemRelations USING (itemID) LEFT JOIN relationPredicates USING (predicateID) WHERE libraryID=? AND itemID IN (20197) [2]

(3)(+0000002): Loaded relations in ENT in 8 ms

(3)(+0000001): Loaded relations in ENT in 4 ms

(3)(+0000003): {error: better-bibtex: <7.0.2 Z97DC2C6>} JSON-RPC: "[error: Zotero.PDFRenderer is undefined\nattachments@jar:file:///C:/Users/ahmed/AppData/Roaming/Zotero/Zotero/Profiles/v9q2yly8.default/extensions/[email protected]!/content/better-bibtex.js:108885:23\n]"

(5)(+0000004): HTTP/1.0 200 OK X-Zotero-Version: 7.0.11 X-Zotero-Connector-API-Version: 2 Content-Type: application/json {"jsonrpc":"2.0","error":{"code":-32603,"message":"TypeError: Zotero.PDFRenderer is undefined"},"id":null}

I searched the codebase, this section might be the offending section.

if (annot.annotationType === 'image') {

BTW I was able to ameliorate the bug via going to zotero and placing my cursor on the culprit PDF attachment (not the parent item) prior to fetching the attachments via json rpc.

Could it have something to do with generating that PDF thumbnail in the sidebar first?

Cheers

@bassio
Copy link
Contributor Author

bassio commented Jan 29, 2025

Just noticed that the offending PDF item had an "image annotation".

I have not confirmed that this bug only happens for PDFs that had marked image "screenshot" annotations, but looks highly likely it may be related to that.

@retorquere retorquere moved this to Awaiting user input in Zotero plugins Feb 22, 2025
@retorquere retorquere moved this from Awaiting user input to In progress in Zotero plugins Feb 26, 2025
retorquere added a commit that referenced this issue Feb 27, 2025
Copy link

🤖 this is your friendly neighborhood build bot announcing test build 7.0.5.7721 ("cleanup")

This update may name other issues, but the build just dropped here is for you; it just means problems already fixed in other issues have been folded into the work we are doing here. Install in Zotero by downloading test build 7.0.5.7721, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@retorquere retorquere moved this from In progress to Awaiting user input in Zotero plugins Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Awaiting user input
Development

No branches or pull requests

2 participants