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 could not add:" #199

Open
Alex986548 opened this issue Sep 2, 2023 · 14 comments
Open

"Error could not add:" #199

Alex986548 opened this issue Sep 2, 2023 · 14 comments
Labels
bug Something isn't working

Comments

@Alex986548
Copy link

Alex986548 commented Sep 2, 2023

Hello,

Thanks for this plug in !

Describe the bug
When I add #cards in front of the lines I want to convert to cards, then click on the Generate Flashcard button, the plug-in works. But if I then add #cards to other lines, it doesn't find them, displaying "Nothing to do. Everything is up to date." When I try to generate them a second time, it displays "Error, could not add:".
I don't understand this sudden bug when everything was working perfectly before.

To Reproduce

  • Steps to reproduce the behavior:
    New note
    Prepare cards with #card
    Click on Generate flashcards
    Add more lines with the #card
    Click on Generate flashcards -> "Nothing to do. Everything is up to date."
    Click on Generate flashcards -> "Error, could not add:"

Expected behavior
Confirmation that flashcards have been added to Anki

Markdown used
Question #card
Answer

context
I noticed that the plug-in worked if I put the lines used to create new cards in a new note, click on Generate flashcards, possibly change a character in the first line and add the generated flashcard to the previous note.

I have the last version of the plugin.

Thanks for your help.

@Alex986548 Alex986548 added the bug Something isn't working label Sep 2, 2023
@github-actions
Copy link

github-actions bot commented Sep 2, 2023

Thank you for taking the time to report the issue and help me to make the project better! 🙂

@innnnel
Copy link

innnnel commented Sep 3, 2023

I have encountered the same issue, and I suspect it is due to the inability of the plugin to add an ID in the new version. I hope the developer can fix it as soon as possible. I really rely on this plugin

@yshhwy
Copy link

yshhwy commented Sep 4, 2023

Try this: #197 (comment)

@Alex986548
Copy link
Author

Try this: #197 (comment)

Thanks for your answer, but can you tell me how we use the file : main_166.zip ?

@borisnaydis
Copy link

@Alex986548, you need to replace the main.js file in the plugin folder (.obsidian/plugins/flashcards-obsidian in my case).
I've just tested it and can confirm that it works.

@Alex986548
Copy link
Author

@Alex986548, you need to replace the main.js file in the plugin folder (.obsidian/plugins/flashcards-obsidian in my case). I've just tested it and can confirm that it works.

Yes, perfect, thanks !

@Zettellotte
Copy link

@Alex986548, you need to replace the main.js file in the plugin folder (.obsidian/plugins/flashcards-obsidian in my case). I've just tested it and can confirm that it works.

I have the same issue. I tried this, but unfortunately the plugin didn't work with the new file in it so I am currently adding the ID of the cards manually.. It takes a lot of time, so I would be very happy about a solution too :)

@Alex986548
Copy link
Author

I have the same issue. I tried this, but unfortunately the plugin didn't work with the new file in it so I am currently adding the ID of the cards manually.. It takes a lot of time, so I would be very happy about a solution too :)

It's strange, this perfectly work for me, I just had to try it two or three times with new notes

@borisnaydis
Copy link

@Zettellotte, it worked for one file, but for some reason, it doesn't work for another one. I'm trying to understand what is causing it but don't see anything meaningful in the console messages.

@Shane-Wood-TL
Copy link

@borisnaydis it seems to work for me when using a new file (one without properties) so I can initially generate cards. Once the cards are generated the properties tab gets added and even after removing it, new cards still will not work.

@Zettellotte
Copy link

I don't know if that could be helpful, but I noticed that recently the generated cards in Anki have the same Card ID as Note ID.. With my older cards this wasn't the case.

@kev-cs
Copy link

kev-cs commented Sep 9, 2023

@borisnaydis it seems to work for me when using a new file (one without properties) so I can initially generate cards. Once the cards are generated the properties tab gets added and even after removing it, new cards still will not work.

I'm observing the same behavior on my side. Whenever there is already a frontmatter section in the file, nothing seems to work properly anymore. When the flashcard generation command is executed, new cards in the file are still added in Anki, but the plugin's operation to add the ID in the file fails with this error logged in the console :

image

The file isn't updated (no ID is added to the card).

@borisnaydis I see you mentioned no errors in the console on your side, that's strange. Additionally, this error doesn't show when using the working main.js on my side.

Try this: #197 (comment)

This worked for me. Everything seems to work fine now, with or without properties in the file.

@AADavin
Copy link

AADavin commented Jan 11, 2024

I am having exactly this problem. Installing the new main.js does not work for me, i am on macOs Monterey

@Zettellotte
Copy link

@AADavin for me it works now, after I changed the name of the new file to what it was before (only "main")

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

No branches or pull requests

8 participants