-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 error in Relay GraphQL VSCode Extension #3975
Comments
Thanks for the bug report @alex-statsig. Do you have any output logs before that? I'm particularly interested in output from when the LSP first starts. Could you clarify exactly which extension settings you have set? |
The "Relay" output included above is the full output for that channel. Here's the full output from "Relay LSP Logs":
|
Getting similar LSP error with the extension
|
I also get the 'Make sure you have Node installed' exception. It doesn't look like node is on the path when the compiler is being spun up. I can run it if i type node to start it, then ctrl-c out and then manually spin up the compiler in watch mode, however, I still dont see any difference. Im using eslint relay, would that cause issues? |
@raghavyadavm @tmitchel2 This is pretty interesting. It seems like whatever shell VSCode is using to spin up these processes is not the shell you use in your terminal (where you have I'm assuming you're using |
@alex-statsig Do you think it would be possible to create a minimum repro repo so I could take a look and inspect further? |
Yes, I am using nvm to manage the node. The path for the node goes to the nvm directory
nvm settings
|
@raghavyadavm which file is that configuration in? |
Zshrc |
@raghavyadavm hmm, I wonder if it would work if you put the nvm stuff in your bashrc |
@tbezman Yeah, here's a minimal reproduction: https://github.com/statsig-io/relay-vscode-repro Seems to hit the exact same issue of "get_schema: schema is missing (or not ready, yet) for the Let me know if you have any issues with this. It uses pnpm to manage packages. |
cc @tbezman any update on this? Thanks |
@alex-statsig hmmm, just pulled down your repo (used pnpm) and things worked like fine. I'll try to dig deeper. @captbaritone do you have any ideas? I'll try to do a bit of digging |
@raghavyadavm any update on your issue? |
@alex-statsig This line from your logs seems sus
Maybe you and @raghavyadavm have the same root cause issue. I'm thinking VSCode's default shell isn't using the shell where you add your |
This seems very inline with what I'm thinking microsoft/vscode-languageserver-node#358 . Looks like the process started by VSCode does not inherit your shell environment by default. |
@alex-statsig @raghavyadavm Would you mind trying out this PR? #4012
|
Ah I didn't have watchman installed before, running "brew install watchman" seems to have resolved the issue. I'm not sure if I'm supposed to need to install it. Would you still want me to try out this PR as a fix without watchman installed? |
@alex-statsig nah I think you're good with just installing watchman. |
Apologies, and thanks for the help debugging. Is that intentional (and just not documented clearly) or will future versions not require it? |
hmmm, yeah I think the only page on the docs site that mentions watchman is here. |
Yeah, and that seems to be only if using "--watch" (which I didn't turn on the setting for in the extension). I've had no issues generally compiling relay without it |
@petrbela would you mind trying this out? #3975 (comment) |
@tbezman Tried that, no change. nvm is loaded in bashrc. |
@petrbela yeah , relay 13 didn't support the lsp yet. hmmm im running out of ideas here. i'm not sure how to get the extension to recognize where the node binary is |
really wish it didn't work on my machine haha |
In a surprising twist of events, I restarted VSCode (and updated to 1.70) and got this error alongside the |
@petrbela so is the takeaway that the |
@tbezman no, I'm using the production version of the extension. Seems like it was something with VSCode environment initialization but it's working now even after restarts so can't confirm for sure. |
@petrbela i wonder if it's different based on whether or not you started VS Code from the cli or not |
The documentation seems to indicate that. Certainly got it fixed when started from the cli. Though as I said, I'm not 100% sure it's causality or just a coincidence. Still, if others are struggling with this, it would be the first thing to try. |
I just restarted the computer, and got the error again (apps reopen after restart). When I then quit VSCode and relaunched it from cli, it's working again. So looks very much like the initialization problem. |
While I'm not a big fan of more configuration, this vscode issue has existed for as long as I can remember and so I don't see it being solved any time soon. Seeing as there's a high chance with node that folks are using nvm, which entirely relies on environment, would it perhaps be an idea to allow an explicit node path? |
I had the same problem. Using zsh in WSL2 and didn't have completions in bash. Copying nvm and every other path thing from .zshrc into .bashrc fixed it 👍 |
I installed node.js and watchman on Windows (instead of remote WSL) to solve the issue. |
hey all, am still having this issue. lmk if theres anything else i can provide to be helpful! |
I tracked this down to the fact that the line Can anyone help me here, please? I am on an M2 Mac and using bash. When I run |
Not sure why watchman is required here? I would rather not install watchman for this. From relay day one I always run it with |
Updated to relay 14 and added the Relay GraphQL extension for VSCode. Upon trying to use features like Intellisense on hover, I see some errors logged to "Relay LSP Logs" output:
I assume my relay config must be set up correctly since relay-compiler works fine. My project is looked at ./console/, but I've added that root to the extension settings (until I did that I saw a different error about not finding a project).
The "Relay" output includes:
The text was updated successfully, but these errors were encountered: