pjeby / tag-wrangler

Rename, merge, toggle, and search tags from the Obsidian tag pane
609 stars 18 forks source link

Rename Tag Error — "TypeError: a.split is not a function" #68

Closed OldSoul-io closed 11 months ago

OldSoul-io commented 1 year ago

Thanks for the beautiful Tag Wrangler plugin and all of your hard work on it!

I tried to rename my #task tag to a #TODO tag for various reasons today:

CleanShot 2023-01-08 at 17 45 44@2x

Unfortunately, this effort returned a TypeError saying, "a.split is not a function."

CleanShot 2023-01-08 at 17 46 11@2x

Being the quasi-hacker-wannabe that I am, I tried looking up the error and found a good explanation of the error in general. But after losing an hour wandering through the source code admiring the work instead, I figure I should file an Issue and step away before my ADHD makes me hyperfocus on it (when I honestly don't have time to figure it out, and you should be the one to know about it in the first place).

I hope the screenshots and description help. Let me know if I can provide further context or if the problem lies between my keyboard and the chair.

pjeby commented 1 year ago

Do you have any tags that are a plain number with no non-numeric characters? Are any of them in an unquoted item in a note's metadata (that also has the #task tag)? If so, please share the metadata here (inside a triple-backquote code block).

OldSoul-io commented 1 year ago

BLUF: I do not have any notes with metadata containing numeric-only tags. After thinking through the below information, I searched to confirm and then tried renaming the #task tag again, with the same resulting error.

I did have some accidental tags that were created from CSS colors, like:

.st-dark-gray {  
    color: #425466;  
}, 

I remedied this by putting said CSS within proper code blocks so that it doesn't mistake them for tags, but those were never in my note's metadata.

I'm not sure if this is related or a possible issue, but I have some #task tags whose line item is nothing but an internal wiki link, like:

- [ ] #task [[Internal Page Link Here]]

pjeby commented 1 year ago

Do you have any notes with an empty Tag or Tags field, then? Or one with null?

OldSoul-io commented 1 year ago

Success! That appears to have been the root cause: I had one template where the tag metadata was left empty by mistake. I updated that field, and everything flowed through successfully as expected.

If that is not expected behavior or a commonly known limitation, perhaps it could be noted somewhere for reference if others run across this error. I'd have never figured that out on my own (and I'm not even sure how I would search for an empty tag, but I immediately suspected my templates were the most probable culprit).

Thanks so much for your help!! You rock. Keep up the awesome work and I hope you have a wonderful weekend!

pjeby commented 1 year ago

This was not a known issue; the numbered tags were, but in any case I intend to fix both, I just wanted to confirm the issue.

pjeby commented 11 months ago

This issue should now be fixed as of Tag Wrangler 0.5.13, released last month.