copilot-emacs / copilot.el

An unofficial Copilot plugin for Emacs.
MIT License
1.72k stars 122 forks source link

JSON RPC server died/exited #187

Closed amusingimpala75 closed 9 months ago

amusingimpala75 commented 9 months ago

I just installed copilot.el but if I try to run copilot-login or copilot-diagnose all I get is the following:

macOS Ventura Emacs 29 I have ensured that s, dash, and editorconfig are installed.

Copilot agent started.
[jsonrpc] Server exited with status 1
jsonrpc-request: jsonrpc-error: "request id=1 failed:", (jsonrpc-error-code . -1), (jsonrpc-error-message . "Server died"), (jsonrpc-error-data)
Copilot agent started.
[jsonrpc] Server exited with status 1
Error during redisplay: (copilot--on-doc-focus #<window 3 on *dashboard*>) signaled (jsonrpc-error "request id=1 failed:" (jsonrpc-error-code . -1) (jsonrpc-error-message . "Server died") (jsonrpc-error-data))
amusingimpala75 commented 9 months ago

Solved because elpaca clones the repo into ~/.emacs.d/elpaca/repos/<name> but the built / compiled form is in ~/.emacs.d/elpaca/build/<name>, and thus since the location of copilot.elc is in the build dir, node cannot find dist/agent.js. Fixed by setting copilot--base-dir to the location of the cloned repo, both in :init and :config. Maybe only one is necessary? Issue #148 was useful in figuring this out.