-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 triggers unhandled rejection when schema endpoint is unavailable #1711
Comments
thanks for the bug report! hmmm... which version of the LSP server are you using? are you using the CLI or the server directly or the vscode or vim extensions? seems this is coming from the thing to note here is that without a valid schema, the server can't really do anything, as all language server features require the schema (except formatting which Prettier plugin provides, thus why we don't ship our own formatting handler), so it will need to exit when schema is not present no matter what. although... i guess because I just implemented auto-reloading when changing the graphql config, it could instead disable all the language server features until the config is changed and a valid schema is present. is that the experience you are expecting? |
Starting the server with: node graphql-language-service-cli/bin/graphql.js server --method stream` with those dependencies:
(also tried the latest version from master) It looks like the problem is indeed in I suppose I should file an issue on
That sounds better to me then exiting the server as exiting would be hard to understand for the user. |
I was wrong, we can trap any exception we need to and handle this from the server and send a client notification as we should |
With a config file like:
And the graphql server not actually running, the LSP server will try to connect to the endpoint and trigger promise rejection that is not unhandled:
Unhandled rejections are bad as with Node 14 those will just crash the process.
The text was updated successfully, but these errors were encountered: