retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.43k stars 291 forks source link

Problem with Auto-Export to CSL JSON, maybe missing ; in JavaScript? #1961

Closed mfhepp closed 3 years ago

mfhepp commented 3 years ago

Zotero version: 5.0.96.3

BBT version: 5.5.4

Support log ID: 3CFADINM-euc

Exporter used: Better CSL JSON

Expected behavior: The reference data should be exported a) automatically when a relevant change is carried out (e.g. a new reference added) b) manually when I click on Preferences -> Better BibTex -> Automatic Export -> Export Now.

Actual behavior: No export is generated in either case. The progress remains at "0%". Clicking on the button "Cached" does not show any reaction.

In the log files, the failed attempted are likely linked to the following errors:

3)(+0000036): {better-bibtex error} +37 could not refresh cacherate: <Error: TypeError: fun is not a function in chrome://zotero-better-bibtex/content/better-bibtex.js line undefined node_modules/lokijs/src/lokijs.js/</Resultset.prototype.find@chrome://zotero-better-bibtex/content/better-bibtex.js:11892:23 node_modules/lokijs/src/lokijs.js/</Resultset.prototype.findAnd@chrome://zotero-better-bibtex/content/better-bibtex.js:11793:15 node_modules/lokijs/src/lokijs.js/</Resultset.prototype.find@chrome://zotero-better-bibtex/content/better-bibtex.js:11832:15 node_modules/lokijs/src/lokijs.js/</Collection.prototype.find@chrome://zotero-better-bibtex/content/better-bibtex.js:13887:20 cached@chrome://zotero-better-bibtex/content/better-bibtex.js:19363:21 > 

...
[JavaScript Error: "TypeError: this.quote is not a function" {file: "chrome://zotero-better-bibtex/content/better-bibtex.js" line: 19130}]
observe@chrome://zotero-better-bibtex/content/better-bibtex.js:19130:29

I am no JS developer, but it may be that adding a semicolon after the commands in

`better-bibtex.js:19130:29``

and similar lines.

mfhepp commented 3 years ago

Or it is the interplay between the missing semicolon and the comments, as in

better-bibtex.ts

lines 29 and 30:

require('./pull-export') // just require, initializes the pull-export end points
require('./json-rpc') // just require, initializes the json-rpc end point
retorquere commented 3 years ago

No, semicolons are (mostly) optional in javascript. It was a scoping issue, a new build will drop here shortly.

github-actions[bot] commented 3 years ago

:robot: this is your friendly neighborhood build bot announcing test build 5.5.4.1704 ("simplify exec")

Install in Zotero by downloading test build 5.5.4.1704, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

mfhepp commented 3 years ago

Thanks! Will check it out asap (tomorrow)!

mfhepp commented 3 years ago

Hi, I tested the new version 1704 - the errors are gone, but the auto export still does not work (simply no update of the output file).

Will submit a new log ID (need to fix my xcode config first, but this is likely not the cause; a manual git status also shows no change after editing a reference.

mfhepp commented 3 years ago

It works now, thanks!

BTW, I deleted the old export and set up a new one - this might have been unnecessary.