TfTHacker / obsidian42-strange-new-worlds

Revealing the strange new world of connected thoughts in your vault.
https://tfthacker.com/SNW
MIT License
438 stars 13 forks source link

Problem when I click on the number of links in a note #95

Closed Valkann closed 1 year ago

Valkann commented 1 year ago

Hello, I have a problem when I click on the number of global links at the top right of a note. Here is what I have in the console.

obs-stg-nw-wrld-bug

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'addClass')
    at lo (plugin:obsidian42-strange-new-worlds:1:41587)
    at async Tr (plugin:obsidian42-strange-new-worlds:1:40964)
    at async po (plugin:obsidian42-strange-new-worlds:1:44492)
    at async On (plugin:obsidian42-strange-new-worlds:1:42867)
    at async en (plugin:obsidian42-strange-new-worlds:1:44913)
    at async eval (plugin:obsidian42-strange-new-worlds:1:58834)
TfTHacker commented 1 year ago

Sorry to hear about this problem. I just released SNW 1.2.0. Would you please update and see if it now works?

TfTHacker commented 1 year ago

Can you disable other plugins to see if there is a conflict?

brsma commented 1 year ago

I'm still experiencing this issue with v1.2.0 (Obsidian v1.3.1) :-( The bug was already there in the previous version. Hard to reproduce alas as it seems to occur quite erratically. At the same time I observed that the bug is consistent with respect to backlinks to the same note. If SNW does not work for that backlink in one note, it neither does anywhere else, wherever that note is linked (including the top right counter in the note itself). No conflict with other plugins or css snippets (had disabled all for testing).

This is the line indicated by the dev tools where it throws the error:

return Array.from(p).find(v=>v.textContent == e.reference.displayText).addClass("search-result-file-matched-text"), i
brsma commented 1 year ago

Can you disable other plugins to see if there is a conflict?

No conflict with other plugins or css snippets (had disabled all for testing).

TfTHacker commented 1 year ago

Thank you for the additional troubleshooting. I added some error handling, and I hope this will solve the issue. I haven't been able to reproduce it, but I do see based on the code snippet where it could fail. Try with 1.2.1 (coming out today)

brsma commented 1 year ago

Fixed for me (both iOS and desktop), thanks a lot!

hustrjh commented 1 year ago

Hi, @TfTHacker. I encountered the same problem before v1.2.1. It's fixed for me now. Thanks for your work. ❤️

But It seems that SNW doesn't totally support markdown link format which is relative path to file. image

It's different in different views. Editing view image

Reading view image

Is there any plan to add this feature? Thank you. 😄