sublimelsp / LSP-Grammarly

Grammarly support for Sublime's LSP plugin, using the Grammarly language server
MIT License
25 stars 1 forks source link

Language server can't start properly #4

Closed DeLaGuardo closed 2 years ago

DeLaGuardo commented 2 years ago

Hi!

I don't know why grammarly language server won't start but I collect some logs. If you need more information I'm happy to add more :) This issue is reproducible in my environment.

logs ``` grammarly: Ready! grammarly: (node:93973) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time grammarly: (Use `node --trace-warnings ...` to show where the warning was created) grammarly: Initialized! grammarly: open file:///[REDACTED]Projects/personal/highlight-parentheses.el/README.md grammarly: node:internal/deps/undici/undici:4813 grammarly: throw new TypeError("Failed to parse URL from " + input, { cause: err }); grammarly: ^ grammarly: grammarly: TypeError: Failed to parse URL from /[REDACTED]Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/18.3.0/grammarly-languageserver/node_modules/web-tree-sitter/tree-sitter.wasm grammarly: at new Request (node:internal/deps/undici/undici:4813:19) grammarly: at Agent.fetch2 (node:internal/deps/undici/undici:5505:29) grammarly: ... 4 lines matching cause stack trace ... grammarly: at new Promise () grammarly: at Parser.init (/[REDACTED]Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/18.3.0/grammarly-languageserver/node_modules/web-tree-sitter/tree-sitter.js:1:332) grammarly: at createParserInner (/[REDACTED]Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/18.3.0/grammarly-languageserver/node_modules/grammarly-richtext-encoder/dist/index.cjs:453:42) grammarly: at Object.createParser (/[REDACTED]Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/18.3.0/grammarly-languageserver/node_modules/grammarly-richtext-encoder/dist/index.cjs:449:20) { grammarly: [cause]: TypeError [ERR_INVALID_URL]: Invalid URL grammarly: at new NodeError (node:internal/errors:377:5) grammarly: at URL.onParseError (node:internal/url:563:9) grammarly: at new URL (node:internal/url:643:5) grammarly: at new Request (node:internal/deps/undici/undici:4811:25) grammarly: at Agent.fetch2 (node:internal/deps/undici/undici:5505:29) grammarly: at Object.fetch (node:internal/deps/undici/undici:6332:20) grammarly: at fetch (node:internal/bootstrap/pre_execution:196:25) grammarly: at /[REDACTED]Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/18.3.0/grammarly-languageserver/node_modules/web-tree-sitter/tree-sitter.js:1:15192 grammarly: at /[REDACTED]Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/18.3.0/grammarly-languageserver/node_modules/web-tree-sitter/tree-sitter.js:1:15413 grammarly: at new Promise () { grammarly: input: '/[REDACTED]Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/18.3.0/grammarly-languageserver/node_modules/web-tree-sitter/tree-sitter.wasm', grammarly: code: 'ERR_INVALID_URL' grammarly: } grammarly: } grammarly: grammarly: Node.js v18.3.0 ```
chapeiro commented 2 years ago

Thank you for reporting that @DeLaGuardo !

  1. Is it easy to try with an older nodejs (preferably 16.15.0)? If you delete this folder: /[REDACTED]Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/18.3.0/ and sublime can't find nodejs, it will automatically download 16.15.0.

  2. Does it also happen with other files? e.g., if you only open this repo's README.md?

DeLaGuardo commented 2 years ago

It works after I uninstall the globally installed node and restart Sublime! Thanks!