ObsidianToAnki / Obsidian_to_Anki

Script to add flashcards from text/markdown files to Anki
GNU General Public License v3.0
1.54k stars 136 forks source link

Anki's new fields does not appear on Obsidian_to_Anki settings in the "Note Type Table. #404

Open turgutaba opened 1 year ago

turgutaba commented 1 year ago

I am a new user of Anki as well as AnkiConnect. However, during the configuration and test to connect to Obsidian, I have one issue with the Obsidian_to_Anki plugin. Even though I created two additional fields on Anki concerning "Basic" note type it does not appear on Obsidian_to_Anki settings in the "Note Type Table." So I am targeting "Basic" for "note type." I searched for errors by pressing "ctrl shift i" and saw an error message. I am not a programmer, so I must figure out what it says and if related to this problem. The error is as follows:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'history') at StatsManager.getDailyWords (plugin:better-word-count:7512:32) at StatusBar.updateAltBar (plugin:better-word-count:7670:64) at eval (plugin:better-word-count:7832:32) at t.e.tryTrigger (app.js:1:1045441) at t.e.trigger (app.js:1:1045374) at t.trigger (app.js:1:1812575) at t.activeLeafEvents (app.js:1:1798403) at s (app.js:1:702707) at l (app.js:1:702813) at r (plugin:obsidian-kindle-plugin:333:35936) DevTools failed to load source map: Could not load content for app://obsidian.md/main.js.map: System error: net::ERR_FILE_NOT_FOUND

Could you help out? Thank you.

cameronj86 commented 1 year ago

In Anki, I tried to rename some custom note types for brevity's sake and those notes are unusable now in Obsidian. Coupled w/ your issue, that leads me to believe that the system might not able to recognize any changes/additions to note types beyond the original sync.

The easiest fix would be to delete and reinstall the Obsidian Plugin to see if that does the trick.

Edit: Appears to be discussed here: https://github.com/Pseudonium/Obsidian_to_Anki/issues/177

myndatlas commented 1 year ago

What you need is the button at the bottom of the Obsidian to Anki settings page under "Actions". It says "Regenerate Note Type Table" and has a button with the text "Regenerate".

In my experiments so far renaming note types in Anki caused problems, but cloning with a new name and then changing the note type manually in Anki (and manually adjusting anything necessary in Obsidian, or perhaps with a find and replace via VS Code or similar if it was much manual adjustment in Obsidian) does seem to work for a way of changing the note type name.