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

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

Open
1 task done
M1CK431 opened this issue Jan 25, 2024 · 28 comments
Open
1 task done

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

M1CK431 opened this issue Jan 25, 2024 · 28 comments
Labels
bug lsp-server graphql-language-service-server

Comments

@M1CK431
Copy link

M1CK431 commented Jan 25, 2024

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

@M1CK431 M1CK431 added bug lsp-server graphql-language-service-server labels Jan 25, 2024
@acao
Copy link
Member

acao commented Jan 25, 2024

@M1CK431 oh noo... i manually tested with vscode-graphql vsix and everything!

@M1CK431
Copy link
Author

M1CK431 commented Jan 25, 2024

I'm using Open VSX as extensions marketplace, don't know if it may have an impact or not 🤷🏼‍♂️
https://open-vsx.org/extension/GraphQL/vscode-graphql

Also, I try to uninstall / reinstall => same issue 😢

@acao
Copy link
Member

acao commented Jan 25, 2024

huh, are you using it with astro files? i cannot reproduce it from the vscode marketplace. i will try again after work

it might be an issue that only effects the ovsx bundle and not the vsix bundle. sadly both can only be manually tested 🥺

@M1CK431
Copy link
Author

M1CK431 commented Jan 25, 2024

I haven't any astro file in my projet (in fact I even don't know what it is 🤭).
I just try to install it manually using the .vsix file downloaded from Open VSX => same error

Perhaps there is an extra check to do on astrojs-compiler-sync existence in the project dependencies? 🤷🏼‍♂️

@M1CK431
Copy link
Author

M1CK431 commented Jan 25, 2024

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

@Dalichowski
Copy link

image
I have the same issue here 😓

@joeiw
Copy link

joeiw commented Jan 29, 2024

I'm also experiencing this error on v0.9.1

[Error - 11:48:13] vscode-graphql client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
node:internal/modules/cjs/loader:966
throw err;
^

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

  • /home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:963:15)
    at Module._load (node:internal/modules/cjs/loader:811:27)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at /home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js:4617:6454
    at /home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js:1:266
    at /home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js:5087:3691
    at /home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js:1:266
    at /home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js:5089:1813 {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/server/index.js'
    ]
    }
    [Info - 11:48:13] Connection to server got closed. Server will restart.
    Initialization failed
    Pending response rejected since connection got disposed
    Error: Pending response rejected since connection got disposed
    at Object.dispose (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:29:4460)
    at Object.dispose (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:22314)
    at Ll.handleConnectionClosed (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:12275)
    at Ll.handleConnectionClosed (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:50478)
    at t (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:11956)
    at ia.invoke (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:2:14331)
    at n.fire (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:2:15100)
    at Lt (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:3:6456)
    at ia.invoke (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:2:14331)
    at n.fire (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:2:15100)
    at Pa.fireClose (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:2:17355)
    at ChildProcess. (/home/joe/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:29:13076)
    at ChildProcess.emit (node:events:525:35)
    at maybeClose (node:internal/child_process:1093:16)
    at Socket. (node:internal/child_process:451:11)
    at Socket.emit (node:events:513:28)
    at Pipe. (node:net:757:14)

@jeremie-stripe
Copy link

Having the same problem, from a cursory inspection it seems this only manifest in situation where the LSP server is ran with a plain nodejs runtime (v18.15.0) rather than the bundled Electron runtime. This happens as well when you are using the remote extensions (e.g. SSH). TL;DR I would bet the problem is that nodejs is trying to load code/modules differently from how Electron does it when running locally with the official distribution.

@acao
Copy link
Member

acao commented Feb 3, 2024

Last week I upgraded ovsx cli and made a new release in the hopes that this would fix the vsix build for ovsx users. For vsce vsix builds it works fine.

Regarding running the LSP outside of an IDE client build - It is marked as a dependency of the graphql-language-service-server, and the LSP tests are passing for node 18, so make sure your environments have been updated for this new dependency.

@M1CK431
Copy link
Author

M1CK431 commented Feb 4, 2024

@acao are you speaking about v0.9.1? If yes, I already try it and experiencing the same issue. Also, if my node version could be important, I'm currently using v21.6.1. Should I try with another version?

@ElYaiko
Copy link

ElYaiko commented Feb 5, 2024

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

@darvids0n
Copy link

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

@M1CK431
Copy link
Author

M1CK431 commented Feb 8, 2024

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? 🤞🏼

@ArmandPhilippot
Copy link

Same issue here with Code OSS on Manjaro with v0.9.1:

Version: 1.85.1
Commit: Unknown
Date: 2023-12-14T20:02:29.406Z
Electron: 25.9.8
ElectronBuildId: undefined
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 6.6.10-1-MANJARO

I'm using Astro but without GraphQL. However I have both extensions enabled globally.

The strange thing is that the output of the Developer Tools (Help -> Toggle Developer Tools) is not exactly the same as the one in Output (which is the same as those already posted). In the Developer tools I don't see any mention of astrojs-compiler-sync. Here the details:

vscode-graphql client: couldn't create connection to server.
c	@	workbench.desktop.main.js:769

Then:

[GraphQL.vscode-graphql]Pending response rejected since connection got disposed
$onExtensionRuntimeError	@	workbench.desktop.main.js:2017

Then:

Error: Pending response rejected since connection got disposed
at Object.dispose (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:29:4460)
	at Object.dispose (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:22314)
	at Ll.handleConnectionClosed (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:12275)
	at Ll.handleConnectionClosed (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:50478)
	at t (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:11956)
	at ia.invoke (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:2:14331)
	at n.fire (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:2:15100)
	at Lt (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:3:6456)
	at ia.invoke (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:2:14331)
	at n.fire (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:2:15100)
	at Pa.fireClose (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:2:17355)
	at ChildProcess.<anonymous> (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:29:13076)
	at ChildProcess.emit (node:events:525:35)
	at ChildProcess.emit (node:domain:489:12)
	at maybeClose (node:internal/child_process:1091:16)
	at ChildProcess._handle.onexit (node:internal/child_process:302:5)

Then:

[GraphQL.vscode-graphql]Client is not running and can't be stopped. It's current state is: starting
$onExtensionRuntimeError	@	workbench.desktop.main.js:2017

Then:

Error: Client is not running and can't be stopped. It's current state is: starting
at Ll.shutdown (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:8615)
	at Ll.stop (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:8194)
	at Ll.stop (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:50088)
	at Ll.doInitialize (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:7732)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async Ll.start (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:4599)
	at async xR (/home/armand/.vscode-oss/extensions/graphql.vscode-graphql-0.9.1-universal/out/extension.js:39:61849)
	at async u.n (/usr/lib/code/out/vs/workbench/api/node/extensionHostProcess.js:140:6255)
	at async u.m (/usr/lib/code/out/vs/workbench/api/node/extensionHostProcess.js:140:6218)
	at async u.l (/usr/lib/code/out/vs/workbench/api/node/extensionHostProcess.js:140:5675)

Then the errors repeat themselves since the server cannot be restarted and finally I get:

The vscode-graphql server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
c	@	workbench.desktop.main.js:769

@hlshen
Copy link

hlshen commented Feb 12, 2024

98af530#diff-282a02f8ecaf263e63ceecdc0702ec641f159a3b9069ad12769816236f0f602e

I believe the "external" params is preventing astro from being installed.

@acao
Copy link
Member

acao commented Mar 5, 2024

unfortunately, if we remove it from external then it doesn't seem to work for vsce or for vscode marketplace 😢
perhaps we can make seperate esbuilds for vsce and ovsx then... !

@acao
Copy link
Member

acao commented Mar 5, 2024

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

@M1CK431
Copy link
Author

M1CK431 commented Mar 5, 2024

Solved in #3547 🥳

@M1CK431 M1CK431 closed this as completed Mar 5, 2024
@acao
Copy link
Member

acao commented Mar 5, 2024

fantastic to hear, thanks for helping!

@Csszabi98
Copy link

@M1CK431 Looks like the fixed version was not published to open vsx, there the latest version is still 0.9.2.
https://open-vsx.org/extension/GraphQL/vscode-graphql

@M1CK431
Copy link
Author

M1CK431 commented Mar 14, 2024

@Csszabi98 That's true but your man is @acao , not me 😉
In the meantime, you can downlad/install it from here: https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql

@acao
Copy link
Member

acao commented Mar 16, 2024

@Csszabi98 I think there is an issue with openvsx publishing again and I will check to restore this before the next release!

@acao
Copy link
Member

acao commented Mar 16, 2024

i will keep this open until we can confirm there is a working release for Open VSX users

i also released a prerelease of 0.10 to openvsx manually, as i did for vscode marketplace. did those show up? huge improvements coming across the board!

@acao acao reopened this Mar 16, 2024
@acao
Copy link
Member

acao commented Mar 17, 2024

ok, so, i learned the hard way that the bundled extension approach for open vsx publishing that appears to fix this issue also does not support pre-release. due to this and another issue I have accidentally published 0.10.1 pre-release as 0.10.1 stable on open-vsx 😆. an accidental bonus, you'll be seeing a fix for this issue as well as many other bugfixes, i apologize if there are any bugs from this refactor that you see before marketplace users do, but we can get this all cleaned up in a few patch releases to both extensions.

unfortunately vsix extensions do not support full semver for pre-releases, so it's tricky to get them working with our release tooling, as it could cause many undesired version increments if we're not careful

@acao
Copy link
Member

acao commented Mar 17, 2024

ok so, the bad news is that 0.10.1 turned out to be a not-good release for schema first users on manual testing because of some assumptions by the integration test suites that didn't pan out. i can't find a way to roll back on openvsx either. i will find a way to rectify this, but i hope to ideally have an 0.9.4 release if I can or an 0.10.2 release to fix this, without the rewrite that currently needs some more tweaking

@acao
Copy link
Member

acao commented Mar 17, 2024

I have asked the eclipse foundation to delete the impacted versions from the registry until we can correct this! Emoji reacts might help boost it :)

EclipseFdn/open-vsx.org#2428

if they aren't able to get back to me by monday, i will just jump the 0.10.x release for 0.11, and make 0.10.2 the fix for all open-vsx users with a matching repeat release for the marketplace just so we're back in sync

@M1CK431
Copy link
Author

M1CK431 commented Mar 17, 2024

I just add a 👍🏼 on the mentioned issue 😘

@acao
Copy link
Member

acao commented Mar 18, 2024

ok! those versions are deleted. partially resolved. I will try to get you a 0.9.4 release to fix tomorrow, and we will keep trying til it does. probably high time i install vscodium and confirm it works myself 😂 0.9.x just fixes svelte and adds astro parsing, but i want to close this ticket once we have a release working on open vsx. 0.10.0 will be a major improvement but I need til next week to do more thorough manual testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug lsp-server graphql-language-service-server
Projects
None yet
Development

No branches or pull requests

10 participants