-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Bug] vscode tsserver crashed when using typescript in a monorepo #1189
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
Comments
Also, In my case yarn root is not the repo root. For example:
|
@arcanis looks like you maintain a typescript patch for this. Can you share some light? I would be happy to help out whatever I can. |
Theres a linked issue in the tsc repo microsoft/TypeScript#37477 I'm also getting this, but my yarn is the root of the repo. |
I believe the relevant patches are linked to this PR: microsoft/TypeScript#35206 |
The problem is that the TS type roots are supposed to be loaded based on the current directory. In the case you describe, since the repo root isn't the Yarn root, the cwd TS is spawned with isn't part of the project, causing the error you see. For what it's worth, my own solution is to always configure the editor-typescript at the root of the repository, and write small tsconfig.json in each workspace that extend the editor one. That requires to make Yarn the repo root, however. |
Verified. One constraint is our sdk plugin require If you have those packages declare in child workspaces it's not gonna work. I am going to update our docs |
Describe the bug
vscode tsserver crashed when having tsconfig.json and typescript installed in a monorepo package (not project root)
error trace.
To Reproduce
I've created a minimal project that can reproduce this issue.
tsserver_crash.zip
switch to use workspace tsc will soon found it crashed.
Environment if relevant (please complete the following information):
OSX
Additional context
Looks like tsc assume tsconfig.json and typescript installed at repo root?
The text was updated successfully, but these errors were encountered: