Bug: "Insert Citation" not working when certain style is missing

I changed my data directory to an empty directory to get a new library. Then, when I'm taking notes, the "Insert Citation" function in this new library stops working (see error report id: 2112781744). The error says "getCiteProc is not a function".

The new data directory lacks several styles (in "styles/" directory) that I possibly added some time before. By copying these styles to the new data directory, "Insert Citation" starts working.

This suggests that some function assumes certain style to be exist (though I can't recall any possible operation that may cause it to rely on user-added styles).

Is it possible to improve the code, so that it uses another style when certain style is missing?

(Also, see this issue, which also discusses this problem: https://github.com/dvanoni/notero/issues/12. They said, "the code assumes that the APA style is available and uses it to generate the name of the Notion page".)
  • Just to be clear, since the error reports are a bit confusing in their mention of several add-ons:

    This can be reproduced in Zotero without any add-ons by uninstalling the main APA style and then trying to insert a citation in a note: this inserts a {citation} placeholder with no further error message (tested in current beta)
  • FYI I tried deleting the file apa.csl in Zotero styles folder:
    "C:\Users\lienart\Zotero\styles\apa.csl"

    But it doesn't generate the error. The apa.csl file is somehow downloaded again when inserting a citation using the APA style.
  • I uninstalled it under styles in the preferences for the test above.
  • We've fixed this for the next beta — thanks.

    (The format is hard-coded and doesn't rely on a specific style, so nothing specific to APA, but it unnecessarily called some citeproc.js code, and if the last-selected citation style no longer existed, it failed.)
  • @dstillman, could you point me to the code for generating citations with that hard-coded format?

    The issues in the Notero plugin mentioned above are caused by a reliance on the APA style, but all I really want is to generate a citation in the "(Author, Date)" format like Zotero does when you insert a citation in a note. If I can do this without having to rely on the presence of the APA style, that would be great.
  • edited 9 days ago
    Are there any news on this ?

    I get the same error as the OP, choosing any of the default styles available in Zotero. These styles seem to be working in Zotero as I can "Style preview" each one of them.

    I am able to avoid the error only if I choose a style that is not part of the default ones, for example "Springer - Basic (author-date)", which I have downloaded from "Get additional styles".

    However, as soon as I use one of the predefined ones, the same error occurs.
  • The issue reported here was fixed. Please start a new thread and report exactly what you are seeing and doing, together with am error report ID
Sign In or Register to comment.