Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not run on arch: SyntaxError #84

Open
mike-lloyd03 opened this issue Aug 3, 2022 · 1 comment
Open

Does not run on arch: SyntaxError #84

mike-lloyd03 opened this issue Aug 3, 2022 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@mike-lloyd03
Copy link

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)
@iamcco iamcco added the help wanted Extra attention is needed label Mar 16, 2023
@dephekt
Copy link

dephekt commented Jul 6, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants