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

Error "Symbol's function definition is void: json-parse-string" in Emacs 27.2 #63

Closed
taquangtrung opened this issue Aug 15, 2021 · 7 comments

Comments

@taquangtrung
Copy link

Hi,

I'm using Emacs 27.2 and when double-clicking to a node, Org-roam UI failed to open the file in Emacs, and threw this error:

Error (websocket): in callback `on-message': Symbol's function definition is void: json-parse-string

I checked the library /usr/local/share/emacs/27.2/lisp/json.el.gz and couldn't find the function json-parse-string.

Could you advise where that function comes from?

@tefkah
Copy link
Contributor

tefkah commented Aug 15, 2021

It says here in the Elisp manual that you need an Emacs compiled with JSON support, which most ways of obtaining Emacs should come with. Notable exception is probably the Windows versions, maybe this thread can help? Let me know if it does, I will add it to the readme.

https://www.reddit.com/r/emacs/comments/d52vlg/anyone_compiled_emacs_on_windows_with_jansson/

@nobiot
Copy link
Contributor

nobiot commented Aug 15, 2021

Windows binary from the official site has no problem on 27.2, which I use; at least I don't have this issue.

@nobiot
Copy link
Contributor

nobiot commented Aug 15, 2021

Looking at this path, though, it's not a Windows system.

/usr/local/share/emacs/27.2/lisp/json.el.gz

@tefkah
Copy link
Contributor

tefkah commented Aug 15, 2021

Yeah that makes sense. Then maybe on of the package managers does not include Emacs with JSON support?

@taquangtrung
Copy link
Author

@ThomasFKJorna @nobiot : Thank you for the pointer!

I'm using Linux 20.2 and compile Emacs 27.2 from source code. I just realized from this website (https://www.masteringemacs.org/article/speed-up-emacs-libjansson-native-elisp-compilation) that I need to install libjansson before running configure Emacs to have native JSON support.

$ sudo apt-get install -y libjansson4 libjansson-dev

$ ./configure
# output of configure
# ...
# Does Emacs use -ljansson?                               yes

Now everything works fine. The function json-parse-string comes from emacs/src/json.c.

@tefkah
Copy link
Contributor

tefkah commented Aug 16, 2021

Great!

@santosardr
Copy link

Despite being closed, I want to confirm this problem in Ubuntu 22.04 LTS. I compiled GNU Emacs 30.0.50 on two machines with 20.04 and 22.04. I perceived the problem only at the 22.04 LTS. However, I am still trying to figure out the reason.

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