Eldoc error when after opening org-roam buffer

I have been getting an “eldoc error” in my emacs when using org-roam. The error looks like this:

eldoc error: (wrong-type-argument number-or-marker-p nil) [4 times]

If I restart my emacs the error isn’t there. Then if, for example, I load an org roam file with org-roam-node-find, and then open the backlinks buffer, org-roam-buffer-toggle, it starts to flash.

From that point on, anytime I will hover over a link it will fire again, and it seems to fire for many actions unrelated to org-roam until I restart again.

Has anyone experienced anything like this?

Normally, a suggestion would be to look at eldoc config rather than org-roam for this type of error message; however, I suggest you look st this issue: Wrong type argument: integer-or-marker-p, nil · Issue #2361 · org-roam/org-roam · GitHub

If you have recently upgraded your Org (not org-roam) to 9.7, the error you see may be caused by the same problem. A solution suggested in the linked issue is to recompile org-roam. How to do this depends on your package manager (built-in package.el, straight or elpaca and so on — if you are on Doom, it’s probably straight but please check). If you use package.el, (package-recompile-all) should do it. You can also manually recompile your org-roam’s .el files.

1 Like

I’ll give these suggestions a try. Thank you for the response.

I am indeed on org 9.8-pre. I use straight package manager, so maybe I can find a way to roll back.

I successfully downgraded to v9.63 of org and so far the eldoc error seems to have vanished. Thank you for the help. I guess the longer term solution here is to wait for eldoc to fix this?

No, try this:

  1. Upgrade Org to 9.7 or 9.8 as you prefer
  2. Recompile Org-roam after Org upgrade (even if Org-roam code has not changed)

I don’t know how best you do step 2 with straight, but I guess you can simply re-install Org-roam. The key is to do it after Org upgrade. The reason is described in the linked GitHub comment above.

1 Like

Okay, I tried that. It seems to be good. But I’ll give it some time and then if so mark this as the solution. Thank you @nobiot. I appreciate the help. Saved me much headache.

Can I ask what is eldoc doing in your workflow? It is usually used by programming language modes and not in a text mode such as org, markdown, etc. I have only started using eldoc for my writing and it is useful but it is only custom. What is your use case?

I actually have no idea what is running it @nobiot. I’ve never seen any error related to it previously. I wonder if it could have been triggered by the fact that the buffer had some #+begin_src tags in it?

Okay, thank you. I can’t be sure about what’s happening on your end… But no worries.