turbo icon indicating copy to clipboard operation
turbo copied to clipboard

[LSP] Extension fails to resolve turbo.path in VSC

Open motss opened this issue 1 year ago • 5 comments

Verify canary release

  • [X] I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/motss/vercel-turbo-8583

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

turbo 2.0.4

Describe the Bug

turbo-not-found

VSC extension always fails to read and the resolve the turbo.path defined in local's .vscode/settings.json file.

None of the following paths work:

"turbo.path": "./node_modules/.bin/turbo"
"turbo.path": "node_modules/.bin/turbo"

This is the error being showing in the Output tab:

starting the turbo extension
manually specified turbo does not exist at path `./node_modules/.bin/turbo`, attempting to locate it
attempting to find global turbo
prompting global turbo
attempting to find local turbo using npm
attempting to find local turbo using yarn
attempting to find local turbo using pnpm
found local turbo at /Users/rongsen/motss/webmod/node_modules/.bin/turbo
using turbo at path /Users/rongsen/motss/webmod/node_modules/.bin/turbo

However, the current workaround can be either:

  1. Using the absolute path works just fine, or
    "turbo.path": "/Users/johndoe/test-turbo/node_modules/.bin/turbo",
    
  2. Use "turbo.useLocalTurbo": true instead as turbo LSP is able to search for local turbo but this can be time-consuming as the extension takes a few tries/ guesses in order to reach to the correct location.

Expected Behavior

VSC extension should read and resolve the turbo.path defined in local's .vscode/settings.json file.

This should be the expected log from the extension instead:

starting the turbo extension
using turbo at path /Users/johndoe/test-turborepo/node_modules/.bin/turbo

To Reproduce

  1. Create any project using turbo
  2. Create .vscode/settings.json
  3. Add "turbo.path": "./node_modules/.bin/turbo"
  4. Reload VSC
  5. Go to OUTPUT tab to see the output from a VSC extension
  6. Done

Additional context

No response

motss avatar Jun 24 '24 11:06 motss

+1 on this, Ive never been able to get this extension to work

TylerNRobertson avatar Jun 24 '24 14:06 TylerNRobertson

I get the same issue, I tried with "turbo.useLocalTurbo": true and also ""turbo.path": "node_modules\\.bin\\turbo" with no success. I also tried all the same things you mentioned above and nothing would work, the extension just quite simply will NOT work.

This is what I see in the output log for the Turborepo Language Server:

[Info  - 11:04:31 AM] root uri: C:\Users\<username>\AppData\Local\Temp\turbod\aa8c81391457a46d\turbod.sock
[Error - 11:04:36 AM] failed to connect to daemon: unable to connect to daemon after 3 retries
[Error - 11:04:36 AM] Server initialization failed.
  Message: Internal error
  Code: -32603 
[Error - 11:04:36 AM] Turborepo Language Server client: couldn't create connection to server.
  Message: Internal error
  Code: -32603 
[Error - 11:04:36 AM] Restarting server failed
  Message: Internal error
  Code: -32603 
[Error - 11:04:38 AM] Server process exited with code 1.
[Error - 11:04:38 AM] The Turborepo Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Shame it doesn't work as the docs brag about how it really enhances the developer's experience when in a Turbo repo, going to have to not bother with it for now. 😢

ShaneYu avatar Aug 23 '24 10:08 ShaneYu

I'd also like to add that even with turbo installed globally on my machine, this extension still does not work and results in the same output.

ShaneYu avatar Aug 23 '24 10:08 ShaneYu

This still is an issue, doesn't look like the extension has been updated since June 2024

TylerNRobertson avatar Dec 04 '24 16:12 TylerNRobertson

windows 11 vscode 1.96.4 vercel.turbo-vsc 2.0.0 [email protected]

$ npm ls -g
C:\Users\<username>\AppData\Roaming\npm
├── [email protected]
└── [email protected]

turborepo extension output

starting the turbo extension
attempting to find global turbo
unable to find turbo: spawnSync C:\WINDOWS\system32\cmd.exe ENOENT
unable to start turbo: spawn C:\WINDOWS\system32\cmd.exe ENOENT

turborepo language server output

[Info  - 오전 10:51:04] Connection to server got closed. Server will restart.
true
[Info  - 오전 10:51:05] root uri: C:\Users\<username>\AppData\Local\Temp\turbod\6ee11d47169ad263\turbod.sock
[Error - 오전 10:51:07] failed to connect to daemon: unable to connect to daemon after 3 retries
[Error - 오전 10:51:07] Server initialization failed.
  Message: Internal error
  Code: -32603 
[Error - 오전 10:51:07] Turborepo Language Server client: couldn't create connection to server.
  Message: Internal error
  Code: -32603 
[Error - 오전 10:51:07] Restarting server failed
  Message: Internal error
  Code: -32603 
[Error - 오전 10:51:10] Server process exited with code 1.
[Error - 오전 10:51:10] The Turborepo Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

lien-dkseo avatar Jan 21 '25 01:01 lien-dkseo

Similar to https://github.com/vercel/turborepo/issues/4608

phcreery avatar Sep 01 '25 17:09 phcreery