reuseman / flashcards-obsidian

🎴 An Anki plugin for Obsidian.md
MIT License
870 stars 86 forks source link

"Error could not add:" #199

Open Alex986548 opened 10 months ago

Alex986548 commented 10 months ago

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

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.

github-actions[bot] commented 10 months ago

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

innnnel commented 10 months ago

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 commented 10 months ago

Try this: https://github.com/reuseman/flashcards-obsidian/issues/197#issuecomment-1702292439

Alex986548 commented 10 months ago

Try this: #197 (comment)

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

borisnaydis commented 10 months ago

@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 commented 10 months ago

@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 commented 10 months ago

@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 commented 10 months ago

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 commented 10 months ago

@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 commented 10 months ago

@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 commented 9 months ago

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 commented 9 months ago

@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 commented 5 months ago

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

Zettellotte commented 5 months ago

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