graphiql: [lsp-server] 🐞 Error: Cannot find module 'astrojs-compiler-sync'

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Server crash with error:

Error: Cannot find module 'astrojs-compiler-sync'

Expected Behavior

Server starts without error

Steps To Reproduce

Simply install the latest v0.9.0 of “GraphQL: Language Feature Support” vscode extension.

Environment

  • LSP Server Version: v0.9.0
  • OS: Archlinux
  • LSP Client: “GraphQL: Syntax Highlighting” vscode extension v1.3.0

Anything else?

Rollback on v0.8.25 => no error

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Reactions: 4
  • Comments: 28 (12 by maintainers)

Most upvoted comments

I also have the same issue, but currently I can work around it by running npm install in the extension’s folder:

cd ~/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/
npm install

Having same issue in MacOS:

Error: Cannot find module 'astrojs-compiler-sync'
Require stack:
- /Users/yaiko/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1082:15)
    at Module._load (node:internal/modules/cjs/loader:927:27)
    at f._load (node:electron/js2c/asar_bundle:2:13377)
    at Module.require (node:internal/modules/cjs/loader:1148:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at /Users/yaiko/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js:4617:6454
    at /Users/yaiko/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js:1:266
    at /Users/yaiko/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js:5087:3691
    at /Users/yaiko/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js:1:266
    at /Users/yaiko/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js:5089:1813 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/yaiko/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js'
  ]
}

Node.js v18.15.0
[Error - 8:26:10 PM] The vscode-graphql server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
Initialization failed
Pending response rejected since connection got disposed
Error: Pending response rejected since connection got disposed

I just add a 👍🏼 on the mentioned issue 😘

fantastic to hear, thanks for helping!

Solved in #3547 🥳

if you’re still experiencing this bug in the latest release of the vscode extension or the CLI, let’s do a poll - please react to this comment with:

  • 👍🏻 Open VSX
  • 👎🏻 VSCode Marketplace (I believe the issue is solved here, but just in case)
  • 👀 CLI user - npm/npx/nvim/sublime/etc

Confirmed this workaround to works from my side too. I use npm i --omit=dev, trying to save a bit space 😉 @acao perhaps it gives you some insights to fix this issue? 🤞🏼

Extra info: I’m using Code OSS, again dunno if it may have any impact.