lsp-grammarly icon indicating copy to clipboard operation
lsp-grammarly copied to clipboard

self is not defined

Open agzam opened this issue 2 years ago • 5 comments

Fails to start a lsp session with "LSP :: Error from the Language Server: Request initialize failed with message: self is not defined (Internal Error)" not sure what has changed, but since recently I can't use the package.

both *grammarly-ls:stderr* and *grammarly-ls* buffers are empty. *lsp-log* buffer says:

Command "/Users/ag/.emacs.d/.local/etc/lsp/npm/@emacs-grammarly/grammarly-languageserver/bin/grammarly-languageserver --stdio" is present on the path.
Command "/Users/ag/.emacs.d/.local/etc/lsp/npm/@emacs-grammarly/grammarly-languageserver/bin/grammarly-languageserver --stdio" is present on the path.
Found the following clients for /private/tmp/* spacehammer-edit Brave Browser *_41207_Brave Browser: (server-id grammarly-ls, priority -1)
The following clients were selected based on priority: (server-id grammarly-ls, priority -1)

agzam avatar May 25 '23 19:05 agzam

This is an upstream issue from @grammarly sdk. If I downgraded to 2.3.17, then everything worked fine again. The latest version (with bug) is 2.4.0.

jcs090218 avatar May 25 '23 23:05 jcs090218

In my case, the workaround of @jcs090218 is not working.

seokbeomKim avatar May 31 '23 01:05 seokbeomKim

Hi, @seokbeomKim! Have you tried downgrade the @grammarly/sdk? It seems to be working on my end! Thanks!

jcs090218 avatar May 31 '23 02:05 jcs090218

How can we downgrade grammarly/sdk? I have also been unable to use Grammarly in my most recent emacs setup.

EDIT: The workaround worked for me: I have installed sdk 2.3.17 on my /tmp:

npm -g --prefix /tmp/grammarly-languageserver install \@grammarly/[email protected]

Then I patched the existing problematic 2.4.0 version under ~/.emacs.d/.cache/lsp/npm/@emacs-grammarly/grammarly-languageserver/lib/node_modules/@emacs-grammarly

Now it seems to work properly. I am not familiar with npm, so maybe there is a less hacky solution.

pati-ni avatar May 31 '23 18:05 pati-ni

I have locked the version for now, see https://github.com/emacs-grammarly/grammarly-language-server/commit/20eb251f78cbd27d9e22792e93c1707c0beebcba. Now you just have to install it like you normally do. :)

I have installed sdk 2.3.17 on my /tmp:

Wow, I didn't know you can do that with npm. Nice! 🚀 👍

jcs090218 avatar May 31 '23 19:05 jcs090218