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

TypeError: style.getCiteProc is not a function #12

Closed
Jutdm opened this issue Nov 17, 2021 · 27 comments · Fixed by #550
Closed

TypeError: style.getCiteProc is not a function #12

Jutdm opened this issue Nov 17, 2021 · 27 comments · Fixed by #550
Assignees
Labels
bug Something isn't working

Comments

@Jutdm
Copy link

Jutdm commented Nov 17, 2021

Hello,

Thanks for this add-on ! I installed i(, but when trying to add a new document, this error message comes in :

"Failed to save item(s) to Notion.
TypeError: style.getCiteProc is not a function"

Do you have an idea of what the problem could be, and how to solve it ?

Thank you !

@dvanoni
Copy link
Owner

dvanoni commented Nov 17, 2021

Hi @Jutdm, thanks for reporting!

To help me track down the issue, could you open the Error Console in Zotero from Tools > Developer > Error Console and then try to save items into Notion again. Could you send me a screenshot of whatever messages you see there?

Also, what version of Zotero are you using?

@dvanoni dvanoni self-assigned this Nov 17, 2021
@dvanoni dvanoni added the bug Something isn't working label Nov 17, 2021
@Jutdm
Copy link
Author

Jutdm commented Nov 17, 2021

Thank you for your quick response !

I'm on Zotero 5.0.

Here is what is written :

image

@dvanoni
Copy link
Owner

dvanoni commented Dec 12, 2021

Hi @Jutdm, sorry for the delay getting back to you.

Can you let me know what format you have selected in Zotero's Export settings? (See screenshot below for what I'm referring to.) I believe the error you're running in to is related to the export format.

Also, can you let me know what other add-ons you're using (if any)?

Thanks!

CleanShot 2021-12-11 at 17 22 33@2x

@Jutdm
Copy link
Author

Jutdm commented Dec 12, 2021

Hello @dvanoni,

Thank you for your response !

I use a French format, and no other add-on. Here is the name of the format :

image

EDIT : actually, when changing the exporting format to APA, the add-on works. But is there any way I could continue to use my current format ?

Thank you,
Ju

@dvanoni
Copy link
Owner

dvanoni commented Dec 12, 2021

@Jutdm thanks for this additional info! It's sounds like we're on the right track. I downloaded the format you're using to try to reproduce the error on my side, but I haven't been able to so far.

Would you mind downloading the latest version of the style to see if that helps at all? I wonder if there have been any fixes to it since you previously installed it. It looks like it was last updated in February.

To additionally help with debugging, would you mind running a snippet of JavaScript in Zotero and sending me the output? You can open the window from Tools > Developer > Run JavaScript (or the French equivalent 😄). Here's the code I'd like you to run:

let format = Zotero.Prefs.get('export.quickCopy.setting');
format = Zotero.QuickCopy.unserializeSetting(format);
Zotero.Styles.get(format.id);

It should output something like this:

CleanShot 2021-12-12 at 10 05 55@2x

Thanks!

@Jutdm
Copy link
Author

Jutdm commented Dec 13, 2021

Hello,

I downloaded this format a few weeks ago, so I guess it already was the latest version.

And here is the output :
image

Thank you !

@dvanoni
Copy link
Owner

dvanoni commented Dec 15, 2021

Thanks @Jutdm! Unfortunately, I'm not seeing anything out of the ordinary in your screenshot. I was curious to see if getCiteProc was going to be returned as something unexpected, but as you can see, it appears to be a function just like in my screenshot...

I'm still digging in to this to see if I can figure out what's causing the issue. I'll keep you posted!

P.S. It looks like someone else has reported running in to the same error in the Zotero Forums.

@github-actions
Copy link
Contributor

🤖 this is your friendly neighborhood build bot announcing test build 0.1.2.18 ("fix: Ensure errors are logged regardless of if they have a stack")

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

@dvanoni
Copy link
Owner

dvanoni commented Dec 15, 2021

@Jutdm would you mind doing me a favor and installing the test build posted above? It won't fix the issue, but it should enable some more error logging that will hopefully be visible from Tools > Developer > Error Console.

After installing the test build, could you open the Error Console and then try syncing items again to cause the error to occur? Then send me a screenshot of the error?

Thank you!

@Jutdm
Copy link
Author

Jutdm commented Dec 15, 2021

Hello !

I actually found a solution. I downloaded the "APA" format to show you the problem, and forgot to delete it after. I put the format "Presses Universitaires de Rennes" back as the default format, and the synchronization actually worked. If I delete APA, it doesn't, but I just have to keep it that way.

I guess this solution is good enough, but thank you very much for your implication in this process ahah !

I just have another little question. If it doesn't take too much time, could you do something for this little issue, please ?

When I add a new document, the title of the document is not added in the "Title" column. Instead, the quotation format of the name and date of the article is the title.
For example : (Goldbeter-Merinfeld, 2021) is the title of the document below, and I would like it to be "Patrimoine, argent et conflits familiaux. Introduction" instead.

image

I would love to have it this way automatically :
image

I tried renaming the column "Title", but it doesn't work. I need to create an additionnal column called "Title", which is not the actual title of the document in the database. I don't know if I make sense here ahah.

Thank you very much !

@dvanoni
Copy link
Owner

dvanoni commented Dec 15, 2021

Ah, I understand what's causing the issue now! Currently, the code assumes that the APA style is available and uses it to generate the name of the Notion page—the (author, year) text that you referred to. I hadn't considered that the APA style could be removed, so that was a bad assumption!

I think this issue is related to a couple others. Someone just mentioned in #14 that they'd also like to have the page name in Notion be the full article title, and others folks in #5 would like to use a different citation key as the page name. So, it sounds like the solution is to make this configurable and not assume that a specific style is installed.

@Jutdm thank you so much for debugging this with me, and I'm glad you were able to find a workaround!

@Jutdm
Copy link
Author

Jutdm commented Dec 15, 2021

Thank you very much for your work, this pluggin is soooo helpful !

@dvanoni dvanoni added this to the Citation style milestone Aug 11, 2022
@swwwwws
Copy link

swwwwws commented Feb 15, 2023

I get the same error when connecting Zotero with Obsidian. I followed the above steps, but it keeps showing the same error.

image

image

@dvanoni
Copy link
Owner

dvanoni commented Feb 16, 2023

@swwwwws, just to confirm, do you have the American Psychological Association 7th edition style installed in Zotero? If not, can you install it from https://www.zotero.org/styles/apa and let me know if you're still encountering the issue?

@swwwwws
Copy link

swwwwws commented Feb 16, 2023

@dvanoni thanks for the quick reply. Yes I installed APA style in Zotero. It was installed and to be sure I installed it again with the .csl file, before I posted yesterday.

image

@dvanoni
Copy link
Owner

dvanoni commented Feb 17, 2023

@swwwwws, I'm a bit stumped on this one. Would you mind sending me another screenshot of the Error Console? This time, could you open it and click the "Clear" button on the top right before triggering the error. Then once you've encountered the error, scroll to the bottom of the window (if necessary) to ensure you capture as much of the latest message as possible. Thanks!

@swwwwws
Copy link

swwwwws commented Feb 17, 2023

@dvanoni This is the whole error log in the two pictures below. I cleared the log beforehand and then immediately triggered the error.

image

image

@dvanoni
Copy link
Owner

dvanoni commented Feb 18, 2023

Thanks for the additional screenshots, @swwwwws. How are you triggering the error?

@swwwwws
Copy link

swwwwws commented Feb 18, 2023

In Obsidian I us Command-P and select Zotero Better BibTex integration. Then the Zotero hovering search bar appears and I select a publication. After a short t time, I get the error in Obsidian.

image

image

image

@dvanoni
Copy link
Owner

dvanoni commented Feb 18, 2023

I did some digging, but I'm unfamiliar with the specifics of Better BibTeX and Obsidian Zotero Integration. I'd suggest reaching out to the maintainers of those plugins to see if they can dig into this further.

I'm not sure if I'm on the right path, but I found a reference to a translator ID in the code of Obsidian Zotero Integration, and the location of that translator in Better BibTeX. You may be able to reference these when reaching out to those maintainers.

@swwwwws
Copy link

swwwwws commented Feb 19, 2023

Thank you for your time and effort! I will bring it to the people who maintain it

@dufourc1
Copy link

@swwwwws I had the same issue and realized I forgot to create a citation format in the Zotero plugin settings on obsidian (I only had a import format). Once I had created a citation format and matched the citation style to the one I was using in my import formats everything worked fine. (see screenshots attached). Hope that helps !

image

image

(Sorry if this should be posted somewhere else, I did not see an issue on the Obisidian Zotero integration github about this subject):

@nicolnt
Copy link

nicolnt commented Feb 19, 2024

Same as mentioned here by @Jutdm #12 (comment), I downloaded the APA style again and it worked, even if I already had a apa.csl in my Zotero styles folder.
Too bad I didn't copy it before updating to be able to compare both versions.

For me, the issue appeared through Obsidian Zotero Integration plugin. And contrary to what was mentioned here by @dufourc1 #12 (comment) I didn't have to create a citation format in Obsidian Zotero Integration plugin settings, updating apa.csl in Zotero styles folder solved it.

@nicolnt
Copy link

nicolnt commented Feb 21, 2024

Seems to be fixed in the next beta: https://forums.zotero.org/discussion/comment/456092#Comment_456092

@dvanoni
Copy link
Owner

dvanoni commented Feb 22, 2024

Thanks for sharing that thread, @nicolnt! I doubt the fix they mention will resolve the issue for Notero because Notero still relies on the APA style specifically, but I'm going to see if I can fix that by using a similar approach with a hard-coded format instead of APA.

@dvanoni
Copy link
Owner

dvanoni commented Mar 2, 2024

Well, I don't know that I'm going to hear back from the Zotero developers on that thread. (I know they're very busy.)

I did some digging, and I think the code to use as a reference lives here.

@dvanoni
Copy link
Owner

dvanoni commented Sep 1, 2024

I think I may have finally fixed this! 🤞 Version 0.6.2 no longer relies on the APA style being installed, so hopefully that resolves things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants