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

Error: Failed to save item(s) to Notion TypeError: content.text is undefined #1

Closed
lisaross opened this issue Oct 1, 2021 · 25 comments · Fixed by #2
Closed

Error: Failed to save item(s) to Notion TypeError: content.text is undefined #1

lisaross opened this issue Oct 1, 2021 · 25 comments · Fixed by #2
Assignees
Labels
bug Something isn't working

Comments

@lisaross
Copy link

lisaross commented Oct 1, 2021

Hiya! First, I just wanted to say thank you SO MUCH for building this integration omg

Second, I'm coming across an error when I move my item into the collection that I have set up to go into Notion. I've forked your code to see if I can uncover the issue and fix/send a PR, but I've never seen zotero plugin code so I'll have to carve out time to learn the structure if I'm going to be of any service. Meantime, I thought I'd pop some troubleshooting info here for you in case you find an easy fix.

Some troubleshooting details:

  1. doesn't seem to matter what kind of item I use
  2. I duplicated your database from notion (the advanced one) so I didn't customize any columns or anything
  3. API is all set up properly to share etc
  4. plugin is installed and config is set up in zotero
  5. I use APA 7th ed style
  6. I do have some other plugins enabled:
    Screen Shot 2021-10-01 at 12 35 16 PM
  7. Zotero version: 5.0.97-beta.46+4cfa23050 (should I go back to non-beta to help testing?) on mac
  8. FWIW the item does go in the collection, so it's not getting hung on that part of the process - does appear to be related to sending to Notion, though I can't fully confirm that yet.

Here's a screenshot of the error:
Screen Shot 2021-10-01 at 12 32 35 PM

Here's a screenshot of the console after trying to move into collection
Screen Shot 2021-10-01 at 12 33 12 PM

Not much to work with, I'm afraid. I'll keep in touch and please let me know if you have any ideas/guidance you could provide.
Thanks again! This is going to be huge - I've seen lots of people in the academic and note-taking spaces talking about how painful reference management in Notion and Roam Research are. Roam has a great plugin that uses pinned betterbibtex citation keys as the title in the roam db to keep them unique. Here's the link for that in case you find it useful: https://alix-lahuec.gitbook.io/zotero-roam/

Thanks again!

@dvanoni dvanoni self-assigned this Oct 2, 2021
@dvanoni
Copy link
Owner

dvanoni commented Oct 2, 2021

Hey, Lisa! Thanks for this great feedback and detailed bug report!

I too had never seen Zotero plugin code until I started working on this, and let me tell you, it's not the most straightforward environment to work in. 😅 I spent hours reading through Zotero source to get this first version out, and I'm sure there's some gotchas I'm completely missing. e.g. I know there's another bug that completely breaks the plugin if you close the Zotero window (without quitting the app) and open it again.

With the info you've provided, I can at least say I think the issue is related to generating the citations for the item (source). I've also been testing on Mac with the same version of Zotero as you and using APA 7th ed, so my gut tells me it may have something to do with one of the other plugins.

I'll try installing some of those plugins to see if I can reproduce the error you encountered. Would you be willing to try disabling some of your plugins to see if any of them appear to be causing the error?

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2021

🤖 this is your friendly neighborhood build bot announcing test build 0.1.1.9 ("Log Quick Copy format and use function for callback instead of undefined")

Install in Zotero by downloading test build 0.1.1.9, 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 Oct 2, 2021

Hey, Lisa. I tried installing all the plugins you have, but I haven't been able to reproduce the error yet.

The last error message in the screenshot of your console (handlers[i] is undefined in translate.js) is leading me to think there's maybe something happening with a translator, but I'm not entirely sure how the Zotero translators work. Do you know if the plugins are providing translators? I wonder if there's some configuration that you have that I don't have on my end.

I've just created another build of the plugin (see bot comment above) where I'm trying a potential fix and also added a log message to see what format is being used when trying to generate the citation. Would you mind installing that build and letting me know if you see a log message like the one below?

Thanks!

CleanShot 2021-10-02 at 13 20 19@2x

@dvanoni
Copy link
Owner

dvanoni commented Oct 2, 2021

Oh also, I forgot to mention that I added a Developer Setup section to the README that should hopefully get you up and running with a local build of the plugin if you want to try hacking on it yourself!

@alexlyttle
Copy link

Hi @dvanoni, if it helps, I get the same error as @lisaross but the only plugin we have in-common is "Better BibTex for Zotero". Some other useful info:

Zotero: 5.0.96.3
Better BibTex for Zotero: 5.5.1
System: macOS Catalina 10.15.7

I stumbled across this repo earlier as I was trying to figure our if Notion would be compatible with my workflow. Thanks so much for sharing this! I'd love to help at some point if need be, although I'd be a novice to Zotero plugins also!

@dvanoni
Copy link
Owner

dvanoni commented Oct 3, 2021

Hey @alexlyttle, thanks for the additional feedback! This helps narrow things down. I'm still trying to determine if the issue is caused by some sort of setting within Zotero itself or within Better BibTeX.

Would you be able to do me a favor and install test build 0.1.1.9, and then after trying to drag an item into the collection, open the error console (Tools → Developer → Error Console). I'm hoping it will output a message that starts with Notero format as seen in the screenshot I posted above. Could you let me know if you see such a message, and if so, let me know what it says?

Thanks!

@alexlyttle
Copy link

I get the following error:

[JavaScript Error: "Notero format: export=f895aa0d-f28e-47fe-b247-2ea77c6ed583"]

@dvanoni
Copy link
Owner

dvanoni commented Oct 6, 2021

@alexlyttle thank you! This helped me reproduce the issue! Here's what I think is happening...

When saving items to Notion, I use Zotero's citation export feature to build the title of the page in Notion and the Full Citation and In-Text Citation properties. I currently use the preference value from Export → Quick Copy → Default Format to determine which citation format to use. However, some of the options for this preference are "Citation Styles" and some are "Export Formats" as you can see in the below screenshot.

I believe the error we're encountering occurs when an Export Format is selected for this preference because they behave differently than the Citation Styles and don't immediately return an object with a text property as we expect. Out of curiosity, what format do you have selected?

I've also realized that several of the Citation Styles aren't really useful as a page title because the in-text citation is just a number that references the bibliography item. For now, I've changed this so it's hard-coded to use APA 7th ed, but I imagine some folks (perhaps yourself?) may want a BibTeX format for this instead.

I'm about to push another test build that should show up as a comment on this issue. Would you mind downloading that and giving it a try to see if it works for you?

Quick Copy formats

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2021

🤖 this is your friendly neighborhood build bot announcing test build 0.1.1.10 ("Ensure Notion text properties do not exceed max supported length")

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

@alexlyttle
Copy link

Thanks for looking into this! My default is "Better BibLaTeX", which exports the citation data in BibTeX syntax. It looks like Citation Styles generates an in-text citation and Export Formats exports the citation data. I can see why this caused an issue.

I downloaded the test build 0.1.1.10 and it worked! The name field in Notion looked like this "(Example et al., 2021)" including the parentheses. In my option, the APA citation style works well, but in the future configuring this style could be a setting for Notero?

@dvanoni
Copy link
Owner

dvanoni commented Oct 7, 2021

Thanks for the feedback! I'm glad it worked for you! I'll go ahead and release a proper update with this fix.

And yes, I think being able to configure the style is a great idea. Out of curiosity, since you're using BibTeX, would a name field using the BibTeX cite key (e.g. ballStaticTypeScriptImplementation2019) be a useful name? Or is there another format that would be more beneficial?

@alexlyttle
Copy link

Thanks!

A BibTeX citation key as the name is a good idea! If that's straightforward to add, it would be a nice to have the option. Plus, citation keys are unique, helping in the case where you have two papers by the same author in the same year. That being said, the current APA style does look good for inline citations in Notion.

Screenshot 2021-10-07 at 09 48 33

@lisaross
Copy link
Author

lisaross commented Oct 7, 2021

OMG you guys. @alexlyttle and @dvanoni I didn't even know this thread was happening and I get the notice it's resolved and I was of NO USE to the discussion at ALL. SO SORRY. You are amazing and I'm going to figure out why my github notifications are busted... thank you both SO much.

@sofivieto
Copy link

Hi @dvanoni I am having the exact same problem with citation format. I am trying to fix it by downloading the test build 0.1.1.10 but for some reason it re directs me to a page that no longer exists. Where can I download it from? Thanks a lot!

@dvanoni
Copy link
Owner

dvanoni commented Jul 15, 2022

Hi @sofivieto! The latest version of the plugin should have the original fix from this issue, so you'll want to use that.

If you were encountering this issue on the latest version, I'm curious what's making it occur again. Can you share which citation format you're currently using for the "Quick Copy" setting described above?

@sofivieto
Copy link

Hi @dvanoni I re install everything and still getting some errors. I am using APA 7th edition as citation format and I'm getting this errors:
Screenshot 2022-07-26 at 16 54 06
Screenshot 2022-07-26 at 16 54 31

@dvanoni
Copy link
Owner

dvanoni commented Jul 27, 2022

Hi @sofivieto, thanks for sharing those screenshots. It looks like all those errors are unrelated to Notero, so we'll need to keep digging a bit.

When you try to perform a sync, do you see an error message pop up in the bottom-right corner of the screen? If Notero is encountering an error, I think that's where we should see it.

This isn't the right error message, but it should look something like this:

@sofivieto
Copy link

Hi @dvanoni I think I was getting a different message before I was using the updated version of the plugin, but I am getting this now:

Screenshot 2022-07-27 at 17 07 38

@dvanoni
Copy link
Owner

dvanoni commented Jul 28, 2022

@sofivieto thanks for that new screenshot. Some other folks have run into this same error before. Is there anything in #62 or #71 that's able to help you?

@sofivieto
Copy link

I finally solved it, @dvanoni thank you so much. The plugin is amazing!

@thesimranvenkat
Copy link

image
Hi! I'm not sure if this is relevant to this page, but this is the error message I'm seeing whenever I add anything onto my collection. I can't seem to synch anything onto Notion :(

@dvanoni
Copy link
Owner

dvanoni commented Nov 29, 2022

Hi, @thesimranvenkat! My best guess is that you might have an extra part in the Database ID field in the Notero preferences.

If the field currently looks something like this:

699ac4ba280c42ff94e1b8e1aab0879c?v=d318de96ca0742ea843917edca38608

then you'll want to remove everything from the ? onward so that it's just the first 32 characters, like this:

699ac4ba280c42ff94e1b8e1aab0879c

Let me know if that helps!

@thesimranvenkat
Copy link

thesimranvenkat commented Nov 29, 2022 via email

@caitlin-ann
Copy link

Screen Shot 2023-02-07 at 12 48 58 PM

First off, thanks so much for creating this! Love using Notero to organise my thesis research.

I've been using it alright but recently, I get this error when trying to sync to Notion. Can't seem to figure out/troubleshoot - any ideas?

@dvanoni
Copy link
Owner

dvanoni commented Feb 8, 2023

Hi, @caitlin-ann! I'm glad you've been enjoying Notero!

This error means that either the Notion database or one of the pages within it was deleted (archived), and Notero is unable to access it when trying to sync. Specifically, this happens when Notero attempts to update a page that it previously synced. Have you changed anything with your Notion setup recently?

If you're able to narrow down the Zotero item that's causing you trouble, you can try deleting the "Notion" link attached to it. If you delete that link and then try syncing again, Notero will create a new page in Notion instead of trying to update the archived page. The "Sync to Notion" item from the right-click menu can make this a bit easier.

Let me know if this helps!

CleanShot.2023-02-07.at.22.21.27-converted.mp4

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
None yet
Development

Successfully merging a pull request may close this issue.

6 participants