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

Plugin doesn't genereate the ID links #407

Closed
marastoniarts opened this issue Feb 22, 2023 · 34 comments
Closed

Plugin doesn't genereate the ID links #407

marastoniarts opened this issue Feb 22, 2023 · 34 comments

Comments

@marastoniarts
Copy link

Hi, since the last update of Obsidian v1.1.15 the Obsidian_to_Anki doesn't work anymore.
The plugin connects with Anki successfully, but doesn't generate the ID info for the new cards. The Obsidian plugin and Anki extension are both enabled, and the Anki is open during the sync process.
The plugin was working fine today before the Obsidian update.

@29yabuki
Copy link

Did you have the same error as below?
image

Mine worked perfectly too before the update

@marastoniarts
Copy link
Author

Did you have the same error as below? image

Mine worked perfectly too before the update

Where can I find the error log? For me the plugin doesn't show a crash message, just doesn't complete the sync process.

@29yabuki
Copy link

If you're using Windows, do ctrl + shift + i then the console will appear.

@romankrru
Copy link

@29yabuki I have same error as you. Plugin is broken after Obsidian v1.1.15 update

@romankrru
Copy link

romankrru commented Feb 22, 2023

Here is the quick and dirty fix:

  1. Go to your obsidian vault folder
  2. Open /.obsidian/plugins/obsidian-to-anki-plugin/main.js with any text editor
  3. Replace line 30603
        while (abstractFile.hasOwnProperty('parent')) {

with

        while (abstractFile && abstractFile.hasOwnProperty('parent')) {
  1. Restart obsidian

I haven't tested it thoroughly but it looks like this fixes the issue

@BenjaminOyarzun17
Copy link

Did you have the same error as below? image

Mine worked perfectly too before the update

hi, same issue here. I am also getting the exact same error log in the console.

@BenjaminOyarzun17
Copy link

worked for me, thanks!

@Solarrixs
Copy link

worked for me, thanks!

Did you follow the steps as stated by @romankrru? It did not work for me, sadly.

@romankrru
Copy link

@Solarrixs try to restart obsdiain

@reizen-desu
Copy link

Here is the quick and dirty fix:

  1. Go to your obsidian vault folder
  2. Open /.obsidian/plugins/obsidian-to-anki-plugin/main.js with any text editor
  3. Replace line 30603
        while (abstractFile.hasOwnProperty('parent')) {

with

        while (abstractFile && abstractFile.hasOwnProperty('parent')) {
  1. Restart obsidian

I haven't tested it thoroughly but it looks like this fixes the issue

This also fixed it for me. Thanks @romankrru

@Angelawu867
Copy link

It didn't work for me as well.

@Solarrixs
Copy link

Solarrixs commented Feb 23, 2023

It didn't work for me as well.

It worked for me after restarting PC / Obsidian / Anki.

@Angelawu867
Copy link

I tried all of that and it still doesn't generate the ID

@Ali-C-Ila
Copy link

Here is the quick and dirty fix:

Thanks for the emergency patch, but I worry about the stability in the long run. I don't know coding at all, but is this really a "proper" way to write code?

@romankrru
Copy link

romankrru commented Feb 24, 2023

I worry about the stability in the long run

This concern is understandable. The proper way would be to make a pull request and release a new version of the plugin. But this project seems to be unmainted. From the look of the github activity, @Pseudonium has been inactive for more than a year.

I have tried other anki/srs plugins and unfortunately none of them provides required flexibility and usability for me.

Hopefully someone would commit to maintain a fork of this project or the maintainer would return to github.

@beresarus
Copy link

Here is the quick and dirty fix:

  1. Go to your obsidian vault folder
  2. Open /.obsidian/plugins/obsidian-to-anki-plugin/main.js with any text editor
  3. Replace line 30603
        while (abstractFile.hasOwnProperty('parent')) {

with

        while (abstractFile && abstractFile.hasOwnProperty('parent')) {
  1. Restart obsidian

I haven't tested it thoroughly but it looks like this fixes the issue

romankrru thank you very much for your help! Everything works with you help.

@marastoniarts
Copy link
Author

Here is the quick and dirty fix:

1. Go to your obsidian vault folder

2. Open `/.obsidian/plugins/obsidian-to-anki-plugin/main.js` with any text editor

3. Replace line 30603
        while (abstractFile.hasOwnProperty('parent')) {

with

        while (abstractFile && abstractFile.hasOwnProperty('parent')) {
4. Restart obsidian

I haven't tested it thoroughly but it looks like this fixes the issue

Thank you very much! Works like a charm!

@marastoniarts
Copy link
Author

@Angelawu867 @beresarus @romankrru Hey guys, this workaround is still working for you? It worked only for the 1st batch of my cards, the second time that I tried sync new cards shows even the message of adding media and file hashes, but stopped generating the ID.
error log

@beresarus
Copy link

marastoniarts, yesterday made changes to /.obsidian/plugins/obsidian-to-anki-plugin/main.js file of the plugin. Everything works fine.
I think your problem is most likely in another.

But to make sure of this, delete the current version of Obsidian. If you have Windows installed, delete folder C:\Users\user\AppData\Roaming . Turn off the Internet, install obsidian v.1.1.9, disable the automatic update option in the settings, turn on the Internet, install the plugin ObsidianToAnki and check.

@lucascrlsn
Copy link

Works for me as well!

@drrager
Copy link

drrager commented Feb 26, 2023

I updated to version 1.1.15 today, which broke the plugin, and this fix didn't work for me. Luckily, my old computer still had the previous version on it, but the plugin didn't work there either for some reason. It was only after I removed excalidraw files from my vault that the plugin was able to run successfully on the previous version. Does this mean Excalidraw is actually breaking the plugin? It hasn't been a problem before.

@Solarrixs
Copy link

Solarrixs commented Feb 26, 2023

@drrager yes, having excalidraw files breaks the plugin - it'll take very long for it to scan. what i do is move the excalidraw folder or files out.

i know its not ideal, but as said above, unless someone commits
to this plugin, we will need to rely on workarounds

@drrager
Copy link

drrager commented Feb 27, 2023

@drrager yes, having excalidraw files breaks the plugin - it'll take very long for it to scan. what i do is move the excalidraw folder or files out.

i know its not ideal, but as said above, unless someone commits to this plugin, we will need to rely on workarounds

How long has that been the case for you? I've been using Excalidraw and Obsidian to Anki together for almost a year, but only now am I running into problems

@Solarrixs
Copy link

@drrager yes, having excalidraw files breaks the plugin - it'll take very long for it to scan. what i do is move the excalidraw folder or files out.

i know its not ideal, but as said above, unless someone commits to this plugin, we will need to rely on workarounds

How long has that been the case for you? I've been using Excalidraw and Obsidian to Anki together for almost a year, but only now am I running into problems

Just started excali 2 weeks ago and started 2 weeks ago (immediately)

@ViktorKensen
Copy link

im no coding expert, how do i fix this? Where is the folder im looking for? Thanks in advance!

@romankrru
Copy link

romankrru commented Feb 27, 2023

im no coding expert, how do i fix this? Where is the folder im looking for? Thanks in advance!

Follow the steps described in #407 (comment)

If you can't find your vault location then it is easy to see if you click Open another vault icon in the bottom left corner and then in the popup window you will see your vault location on the left.

You might not be able to see .obsidian folder in your vault if you are on mac/linux because the file manager might hide files starting with the dot. In this case google how to show hidden files on your system

@Rri-bit
Copy link

Rri-bit commented Feb 27, 2023

I'm not a tech-savvy either :((
Downgraded Obsidian to 1.1.9, and the plugin seems to connect, but nothing eventually happens and obsidian just freezes.
Any advice/recommendation, please?

@Solarrixs
Copy link

I'm not a tech-savvy either :((
Downgraded Obsidian to 1.1.9, and the plugin seems to connect, but nothing eventually happens and obsidian just freezes.
Any advice/recommendation, please?

Do you have excali draw, read up for recommended steps if you do have it

@Rri-bit
Copy link

Rri-bit commented Feb 27, 2023

Actually, I don't

I reinstalled the plugin again, and it acts like it works, but there are no new flashcards created in Anki. Interesting......

@Rri-bit
Copy link

Rri-bit commented Feb 27, 2023

Update: it finally worked after downgrading to 1.1.9 (as described above) and reinstalling(!!) the plugin.
Many-many thanks!

@CTCSU
Copy link

CTCSU commented Feb 28, 2023

Here is the quick and dirty fix:

1. Go to your obsidian vault folder

2. Open `/.obsidian/plugins/obsidian-to-anki-plugin/main.js` with any text editor

3. Replace line 30603
        while (abstractFile.hasOwnProperty('parent')) {

with

        while (abstractFile && abstractFile.hasOwnProperty('parent')) {
4. Restart obsidian

I haven't tested it thoroughly but it looks like this fixes the issue

Thanks very much! This works for me.

I'm wondering if we have any approach to push such changes to master? I'd like to maintain it, but seems the code owner has been missing for a long time.

@ChmielewskiKamil
Copy link

@romankrru
You are a goddamn genius. Thank you so much, my saviour!

@lgoppelt
Copy link

@romankrru
Worked for me as well. Thank you Sir.

@ShootingKing-AM
Copy link
Member

This is fixed now in latest release. Can be closed as solved.

(cc: @Pseudonium)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests