Closed shawndumas closed 11 years ago
Could it be that your .tern-project
(or a .json definition file) isn't syntactically valid?
Thanks for your input. I think my .tern-project
file is ok. I intentionally added a syntax error to it and the tern server failed to start, but that's not what's happening with my original file. Also, this same project is working on my two other computers without issue.
I relized that my .gitignore
was ignoring the file so I changed it and added my .tern-project
file to the repo.
Thanks again.
So that didn't solve it? Try running the server (bin/tern
manually from the directory that has your .tern-project
file, and see if it spits out something useful when/if it crashes.
Like this?
If so I see no discernible errors...
Well, that's too bad. Does Vim's message window show any more details when the problem happens?
No. Just the JSON parse error: Unexpected token &
error.
I added the following to tern
:
And this was the result:
Thanks for looking into this further. So it appears the client (the Vim plugin) is sending a request containing just '&&&'. That is truly bizarre. I looked over the code again, but it should definitely be sending the output of JSON.dumps
, which can't ever sanely be '&&&'.
Do you have a network sniffer installed? (Something like wireshark or ngrep.) It would be interesting to see the actual traffic that's being generated. Or maybe add log statements to the plugin code to see what it is trying to do.
I don't know vimscript and I don't have ngrep or wireshark installed (and I'd have to build from source on that box) so I just socat'ed up a proxy, changed the port in .tern-port
to point to it and dumped the req/resp (socat -v TCP-LISTEN:xxxx TCP:localhost:xxxx).
It's messy but here is what is getting sent.
[edit] compiled and installed ngrep; here's the output.
sorry, hit the close button on my iPhone by accident.
Thanks for capturing the net traffic. It does look like the client is sending perfectly valid JSON, yet the server ends up getting a request containing just a bunch of ampersands. This is a little odd.
Since the problem appears to depend on the vim/python side, an HTTP client library error seems likely. But the request you captured looks valid. The setting comparison also doesn't point out any obvious problems. Python 2.6 vs Python 2.7 seems a likely candidate, but we've tested with 2.6 before, and that time it worked.
I'm stumped, I must say.
ok, thanks for trying.
I have installed it on my Mac (OSX Mavericks), and on my Linode (Ubuntu 12.04.3 LTS) and it's working wonderfully but I cannot seem to get it working on my Red Hat Enterprise Linux Server release 6.4 (Santiago).
The repo that works in two out of the three envs is my fork of emile.
Using Vundle to load. I ran
npm install
in.vim/bundle/tern_for_vim/
.My
.vimrc
just in case you need it.