1

I'm trying to use tern with the latest version of emacs (27 : master branch) and I'm getting the following error :

Request failed: ((wrong-type-argument Need a pre-parsed URL. [cl-struct-url http nil nil 127.0.0.1 39585 / nil nil nil nil t] url))

Basically : tern is unable to perform any kind of request because of this error.
It seems to come from tern-req function in tern.el, this line :

(url (url-parse-make-urlobj "http" nil nil tern-server port "/" nil nil nil))

But I don't know how to fix it, 'cause I'm not really familiar with lisp development.

I've opened an issue on Github, but since "Tern is not being actively maintained right now.", I'm asking here

Drew
  • 75,699
  • 9
  • 109
  • 225
boehm_s
  • 183
  • 2
  • 7

1 Answers1

2

Your tern package was compiled with the older Emacs, but the newer Emacs has changed the representation of structs: the [cl-struct-url http nil nil 127.0.0.1 39585 / nil nil nil nil t] in your error message is an "old-style" struct, returned by the old url-parse-make-urlobj. This happens because this function was inlined when tern was compiled.

You can try to enable (cl-old-struct-compat-mode 1) which was designed to try and accommodate those circumstances. If that fails to solve your problem then you'll need to recompile your tern package.

Stefan
  • 26,154
  • 3
  • 46
  • 84