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

The path /.../tsserver.js doesn't point to a valid tsserver install. Falling back to bundled TypeScript version. #22606

Open
1 task done
ineghi opened this issue Jan 3, 2025 · 9 comments
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue

Comments

@ineghi
Copy link

ineghi commented Jan 3, 2025

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Fresh install, opening any project without Typescript.

When opening a project in zed, this warning pops up;

Vtsls
The path /Users/{local_project}/node_modules/typescript/lib/tsserver.js doesn't point to a valid tsserver install. Falling back to bundled TypeScript version.

Zed Version and System Specs

Zed: v0.167.1 (Zed)
OS: macOS 14.3.1
Memory: 64 GiB
Architecture: aarch64

If applicable, attach your Zed.log file to this issue.

Zed.log

@ineghi ineghi added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Jan 3, 2025
@ineghi
Copy link
Author

ineghi commented Jan 3, 2025

I've tried to configure vtsls to use a local typecript install, but does not change anything (still points to the non-existing local tsserver.ts);

  "lsp": {
    "vtsls": {
      "initialization_options": {
        "typescript": {
          "tsdk": "~/.yarn/bin"
        }
      }
    }
  }

(on my computer, .yarn/sdks/typescript/lib does not exist)

@ineghi
Copy link
Author

ineghi commented Jan 3, 2025

I had more luck using "settings" to configure vtsls, and the lib folder of my global typescript install.

  "lsp": {
    "vtsls": {
      "settings": {
        "typescript": {
          "tsdk": "~/.config/yarn/global/node_modules/typescript/lib"
        }
      }
    }
  }

Still, the original warning should not happen (right ?).
If vtsls find a local install, fine, otherwise it should defaults to bundled one silently.

@ineghi
Copy link
Author

ineghi commented Jan 3, 2025

could relate to #18410

@Rocco-Gossmann
Copy link

Maybe add a setting to tell Zed to use the internal TSServer by default.
That way you wouldn't need to throw a Warning, if a "None Node-Project" does not have a "node_modules" Folder.

@cu8code
Copy link

cu8code commented Jan 7, 2025

Using a mono-repo, Zed automatically takes the .git folder as the root, making it impossible to open individual projects separately. The error clearly says its trying to find the path at root {root}/node_modules/typescript/lib/tsserver.js vscode dose not have this problem; let me see if I solve it! will make a PR

@cu8code
Copy link

cu8code commented Jan 7, 2025

found a solution

#18410 (comment)

@kaikojima05
Copy link

kaikojima05 commented Jan 9, 2025

I also ran into the same issue. However, after configuring zed as shown below, the warning went away.

  "lsp": {
    "vtsls": {
      "settings": {
        "typescript": {
          "tsdk": "~/.nvm/versions/node/v21.7.3/lib/node_modules/typescript/lib"
        }
      }
    }
  }

@ilya-sarantsev
Copy link

Just to add a bit of info: it started showing

The path /Users/ilya/Library/Caches/typescript/5.7/node_modules/@types/eslint-plugin-jsx-a11y/node_modules/typescript/lib/tsserver.js doesn't point to a valid tsserver install. Falling back to bundled TypeScript version.

error right after I have installed and configured eslint-plugin-jsx-a11y

@joshuaia
Copy link

joshuaia commented Jan 9, 2025

Guys, please stop this.
All your suggestions are incorrect, and you're just spamming without even investigating the cause of this bug.

The problem is not related to your package installation or the use of a different package manager. Those factors are irrelevant.

The "solution" of defining the TS lib path in the settings is also incorrect. This approach hardcodes a predefined path, which will be applied to all projects opened in Zed globally. This is problematic because you may work on different projects with different versions of TypeScript, making this solution unsuitable. As you can understand, this approach is flawed.

Since this bug appeared in version v0.167.x, and there were no release notes regarding changes to how vtsls works, it’s evident that this is simply a bug that will likely be fixed soon. Zed should automatically load the appropriate TS lib based on the project where it’s installed.

P.S.: Since this issue still has the admin read label, it means it is under review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue
Projects
None yet
Development

No branches or pull requests

6 participants