hadynz / obsidian-sidekick

A companion to identify hidden connections that match your tags and pages
134 stars 9 forks source link

Errors when using plugin #1

Closed HEmile closed 2 years ago

HEmile commented 2 years ago

Hi, loving the idea of this plugin! I don't see anywhere in my vault where it is working yet though. It is giving me several TypeErrors too:

image

Quorafind commented 2 years ago

image

Same here

simontang commented 2 years ago
image

just click the highlight word

hadynz commented 2 years ago

Thanks all for sharing the errors you were getting.

The plugin indexes any aliases defined in frontmatter to use as keyword of connections. Aliases can be defined as strings, arrays or even be malformed. This plugin didn't cater for that.

1.0.1 should resolve this. Please give it a go and let me know if it has resolved this issue.

Quorafind commented 2 years ago

image

Is this related to the problem also? It occurs in 1.0.1

hadynz commented 2 years ago

I've added more logging for the specific error that you are getting.

Can you update to 1.0.2 and share:

Quorafind commented 2 years ago

First:

image

image

---
uid: 202112311951
tags:
  - writings
  - idea
aliases:
  - 年终总结
  - 总结
  - 2020
---

Second:

image

image

---
title: Awesome-academics
uid: 202009071818
tags:
  - pkm
  - Extraction
aliases: 
  - 学术
  - 
date updated: '2020-12-17T11:02:33+08:00'

---

Third:

image

---
uid: 202101152149
tags:
  - writings
  - idea
aliases:
  - 年终总结
  - 总结
  - 2020
date updated: '2021-02-01T14:03:33+08:00'
---
Quorafind commented 2 years ago

Hope this help!

hadynz commented 2 years ago

This is great. Thank you so much.

The issue is that you have types of aliases that I didn't cater for - (a) numbers and (b) empty line (or bulls)

The fix is straight forward. Will do it straight after breakfast 😅

hadynz commented 2 years ago

Alright, can you give 1.0.3 a go. It should handle the aliases in the examples you've shared.

Quorafind commented 2 years ago

image

image

image

Seems like another error comes. but the first error is resloved now!

hadynz commented 2 years ago

@Quorafind can you try the latest 1.0.4 please?

I believe I found the issue - a bug clicking on any upper cased suggestion. The in-memory search index that I use lower cases all values.

Quorafind commented 2 years ago

image

Yes, it fixes questions above. but a new error comes, sorry to tell you about this. 😂

HEmile commented 2 years ago

Some more stuff I'm seeing on 1.0.4:

image

Probably a + in the file title (and possibly other characters) isn't escaped properly in a regex

hadynz commented 2 years ago

I've done a bunch of tweaks that I am hoping 🤞 will auto-magically fix your issues in 1.0.5. That is quite a wishful thought as I don't have enough debugging to determine the actual problem that you are running.

If this doesn't fix your issue, I'll add more debugging messages to try and get to the bottom of the problem.

Probably a + in the file title (and possibly other characters) isn't escaped properly in a regex

If you can share with me a list of example file titles that you think could be causing this problem I can test it quickly at my end.

Quorafind commented 2 years ago

[[2d3 Zettelkasten]] - 快速记录对于zettelkasten笔记的推动 don't know why here remains highlight : image image image

HEmile commented 2 years ago

I've done a bunch of tweaks that I am hoping 🤞 will auto-magically fix your issues in 1.0.5. That is quite a wishful thought as I don't have enough debugging to determine the actual problem that you are running.

If this doesn't fix your issue, I'll add more debugging messages to try and get to the bottom of the problem.

Unfortunately not. The one that is causing it at least is "IDF++ Analyzing and Improving Integer Discrete Flows for Lossless Compression". I'm not sure if there are others... Probably those involving '-' too? I'm only seeing this error.

Still no highlighting at all for me, btw.

HEmile commented 2 years ago

If you are having trouble/are busy, I can try to debug it on my end. Won't be able to do that in the next couple days though, likely.

hadynz commented 2 years ago

Thanks for your help @HEmile. I am currently using a plugin to do search for me that uses Regex in its pipeline. I believe it is the one causing the issue that is being experienced here.

I am looking now to overhaul how searching and indexing works in the plugin to:

I am hoping this will solve the issue being encountered in this thread.

Will update you once this change is complete.

hadynz commented 2 years ago

I've just released 1.1.0 which is a rewrite for how search and indexing works. You can see details about the change in https://github.com/hadynz/obsidian-sidekick/pull/9.

Can you guys give this a try and let me know how it works at your end please.

HEmile commented 2 years ago

Hey, thanks for the update! Unfortunately, I'm getting another error now

app.js:1 TypeError: Cannot read properties of undefined (reading 'replaceText')
    at eval (eval at <anonymous> (app.js:1), <anonymous>:59:67453)
    at Array.map (<anonymous>)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:59:67388)
    at Array.reduce (<anonymous>)
    at s.toSearchResults (eval at <anonymous> (app.js:1), <anonymous>:59:67342)
    at s.find (eval at <anonymous> (app.js:1), <anonymous>:59:67201)
    at e.r.ViewPlugin.fromClass.e.decorateView (eval at <anonymous> (app.js:1), <anonymous>:59:60063)
    at new e (eval at <anonymous> (app.js:1), <anonymous>:59:60798)
    at t.create (app.js:1)
    at t.update (app.js:1)
HEmile commented 2 years ago

More context: image Ie it's getting a hit on 'acquir', but this is not a name/alias in my vault at all (indices['acquir']=undefined). I think something might be going wrong with the offset of where it's looking in the document. image

Quorafind commented 2 years ago

And seems like it cannot suggest file name anymore? image

hadynz commented 2 years ago

Ie it's getting a hit on 'acquir', but this is not a name/alias in my vault at all (indices['acquir']=undefined). I think something might be going wrong with the offset of where it's looking in the document.

The plugin now is using a concept called "stemming" (the Porter stemmer algorithm to be exact) by default to try surface as many connections as possible. So it is possible that you have a tag or a page name that contains a word that stems to acquir. For example acquire or acquiring.

In #11 I made an update to skip any words that could be missing so you don't run into this problem anymore. Try out release 1.1.1.

HEmile commented 2 years ago

I see! It's definitely working for me now, up to some degree at least! I'll add a couple more issues now that I got it to work somewhat :)