diagnostic-languageserver icon indicating copy to clipboard operation
diagnostic-languageserver copied to clipboard

Does not run on arch: SyntaxError

Open mike-lloyd03 opened this issue 2 years ago • 1 comments

Describe the bug Does not run on Archlinux when installed from AUR. This used to work fine but sometime in the last few months, I get a syntax error when trying to run the binary.

To Reproduce Steps to reproduce the behavior:

  1. Install diagnostic-languageserver from AUR
  2. Run diagnostic-languageserver

Expected behavior Binary runs

Desktop: diagnostic-languageserver version: 1.14.2-1 (According to the AUR) node version: v12.22.12 linux kernel: 5.18.15 distro: arch

Log:

/usr/lib/node_modules/diagnostic-languageserver/node_modules/vscode-jsonrpc/lib/common/linkedMap.js:40
        return this._head?.value;
                          ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/lib/node_modules/diagnostic-languageserver/node_modules/vscode-jsonrpc/lib/common/api.js:37:21)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

mike-lloyd03 avatar Aug 03 '22 19:08 mike-lloyd03

I have the same issue but on Ubuntu 22.04. I installed via yarn global add diagnostic-languageserver and run node version 18.15.0. When I activate the language server in Sublime Text 4, I get the following stack dump:

diagnostic-ls: /home/dephekt/.config/yarn/global/node_modules/vscode-jsonrpc/lib/common/linkedMap.js:40
diagnostic-ls:         return this._head?.value;
diagnostic-ls:                           ^
diagnostic-ls: 
diagnostic-ls: SyntaxError: Unexpected token '.'
diagnostic-ls:     at wrapSafe (internal/modules/cjs/loader.js:915:16)
diagnostic-ls:     at Module._compile (internal/modules/cjs/loader.js:963:27)
diagnostic-ls:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
diagnostic-ls:     at Module.load (internal/modules/cjs/loader.js:863:32)
diagnostic-ls:     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
diagnostic-ls:     at Module.require (internal/modules/cjs/loader.js:887:19)
diagnostic-ls:     at require (internal/modules/cjs/helpers.js:74:18)
diagnostic-ls:     at Object.<anonymous> (/home/dephekt/.config/yarn/global/node_modules/vscode-jsonrpc/lib/common/api.js:37:21)
diagnostic-ls:     at Module._compile (internal/modules/cjs/loader.js:999:30)
diagnostic-ls:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

In my case, it was because I didn't have yarn global bin in my PATH, so in Sublime Text's LSP configuration, I had a full path to diagnostic-languageserver binary like:

"clients": {
        "diagnostic-ls": {
            "enabled": true,
            "command": ["/home/dephekt/.yarn/bin/diagnostic-languageserver", "--stdio"],

And apparently this won't work properly. I added export PATH="$(yarn global bin):$PATH" to my .profile and changed the command here to just diagnostic-languageserver rather than the full path and now everything works as expected.

The OP didn't mention what editor they're using, but in case anyone stumbles on this with Sublime like I did, hopefully this helps them.

dephekt avatar Jul 06 '23 19:07 dephekt