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

Getting error with obsidian-jump #99

Open
emacsbliss opened this issue Aug 23, 2024 · 7 comments
Open

Getting error with obsidian-jump #99

emacsbliss opened this issue Aug 23, 2024 · 7 comments

Comments

@emacsbliss
Copy link

When I invoke M-x obsidian-jump, I got error:

Debugger entered--Lisp error: (wrong-type-argument sequencep :null)

Here's the full backtrace:

Debugger entered--Lisp error: (wrong-type-argument sequencep :null)
  obsidian-find-tags("---\nposter: https://m.media-amazon.com/images/M/MV5BMzcwYWFkYzktZjAzNC00OGY1LWI4YTgtNzc5MzVjMDVmNjY0XkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_SX300.jpg\nimdbId: tt0268978\nscoreImdb: 8.2\nlength: 135 min\ngenre: Biography, Drama, Mystery\nyear: 2001\ncast: Russell ...")
  obsidian-find-tags-in-file("/Users/emacsbliss/obsidian/Movies/A Beautiful Mind.md")
  obsidian-list-all-tags()
  obsidian-update-tags-list()
  obsidian-update()
  obsidian-jump()
  funcall-interactively(obsidian-jump)
  command-execute(obsidian-jump record)
  execute-extended-command(nil "obsidian-jump" "b")
  funcall-interactively(execute-extended-command nil "obsidian-jump" "b")
  command-execute(execute-extended-command)

Here's the full content of file A Beautiful Mind.md:

---
poster: https://m.media-amazon.com/images/M/MV5BMzcwYWFkYzktZjAzNC00OGY1LWI4YTgtNzc5MzVjMDVmNjY0XkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_SX300.jpg
imdbId: tt0268978
scoreImdb: 8.2
length: 135 min
genre: Biography, Drama, Mystery
year: 2001
cast: Russell Crowe, Ed Harris, Jennifer Connelly
director: Ron Howard
tags: 
rating: 
status: complete
---

# Plot 
A mathematical genius, John Nash made an astonishing discovery early in his career and stood on the brink of international acclaim. But the handsome and arrogant Nash soon found himself on a harrowing journey of self-discovery.

my M-x emacs-version reports this:

GNU Emacs 29.4 (build 2, aarch64-apple-darwin23.3.0, NS appkit-2487.40 Version 14.3.1 (Build 23D60)) of 2024-08-03

Thanks!

@emacsbliss emacsbliss changed the title obsidian-jump got error Getting error with obsidian-jump Aug 23, 2024
@licht1stein
Copy link
Owner

licht1stein commented Aug 26, 2024

My guess is that the url is not parsed correctly as a tag. Can you remove the "poster" tag and try again, just to check?

@emacsbliss
Copy link
Author

removing the poster tag does not seem to work, got same error from other front-matter fields

@rross101
Copy link

Same issue here. Did you find a solution?

@jayemar
Copy link
Collaborator

jayemar commented Oct 28, 2024

I believe the issue is with your tags: key not having a value, and more specifically the value not being a list. If you either removed the tags key, or gave it an empty list as a value a la tags: [], then I think it would fix your issue. You may want to do the same with the rating key while you're at it.

To be more specific, the :null is returned from the call to yaml-parse-string because you have a keys in your front matter that don't have matching values. In your example, both tags and rating are empty keys that will therefore be returned with :null values.

As the function yaml-parse-string isn't parst of obsidian.el it's hard to handle this kind of error gracefully; I think the best options we'd have is to ignore the file altogether when this sort of YAML parsing error occurs, so ideally the user would only include valid yaml in the front matter.

@licht1stein
Copy link
Owner

licht1stein commented Oct 29, 2024 via email

@jayemar
Copy link
Collaborator

jayemar commented Oct 30, 2024

That makes sense. My changes in PR #100 prevent the error from being thrown, but there's no message telling the user that the front matter is being ignored for a specific file. I'll look into adding that.

@jayemar
Copy link
Collaborator

jayemar commented Dec 6, 2024

That makes sense. My changes in PR #100 prevent the error from being thrown, but there's no message telling the user that the front matter is being ignored for a specific file. I'll look into adding that.

PR #100 has been updated to alert the user that a file was not able to be parsed due to a yaml parsing error.

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

4 participants