-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
TypeScript's dependency on electron limits the heap size to a point that breaks monorepos, and tsserver-bridge is no longer a workaround #151245
Comments
ipc was recently added to tssever for perf reasons; if you're using VS Code I'm guessing there's a flag that could be passed to disable it? Maybe we (the server or somewhere in the client) need to be checking for |
If you pass TSServer
|
what does this mean? The whole tsserver-bridge package is pretty, short, would appreciate a pointer of what to change here. The stack trace I shared is already using |
The bridge code creates a script in place of tsserver that spawns the real tsserver as a subprocess, inheriting stdin/stdout/stderr so that subprocess can communicate with the client. But newer versions of TS and VS Code support IPC, and so the wrapper script in the middle has to proxy the IPC traffic as well if Otherwise, the client and server will attempt to communicate over IPC and then crash in the IPC code, as your trace shows. |
We discussed this today and decided VS Code should possibly let users opt into spawning TS Server in their own installed version of Node (and inform TS Server so it can communicate over STDIO as before, IIUC). @mjbvz was going to see if other language extensions have run into something similar. Matt, can I transfer this issue to VS Code for now? |
Is there a related issue on vscode side? |
Assigning to @mjbvz since I don't have rights to transfer this to the VS Code repo 😅 |
This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Can we keep this open until the vscode team actively takes ownership? |
Thanks for taking ownership of this task in the vscode project. I'm trying to understand if our team needs to work around this issue by patching tsserver-bridge or not. Is this issue a priority for vscode, and is it easy to fix? |
Our proposal is to let users specify a path to |
@mjbvz : Can you point me to relevant code? I've never touched this codebase. |
Okay, here is a rough proposal... New config: I'll update and rename |
Yes that sounds like the correct approach. A few points:
|
Is the "validate" word a naming convention, and what does it imply? Where does the validation logic happen? |
|
Reopening to track letting users point to a node executable for running tsserver |
@mjbvz regarding your comment above:
Where should that be logged? |
I hadn't noticed, but #172719 is actually also the same request! |
Friendly ping! Looks like this issue requires some further steps to be verified. Please provide us with the steps necessary to verify this issue. |
For verification, this is a duplicate of #172719. Marking as verified based on that issue |
Bug Report
Electron enforces a heap memory limit (due to pointer compression) that causes typescript to crash in large mono-repo. This was originally reported here, and then on the electron side here. One common workaround is to use tsserver-bridge to cause vscode to launch the typescript editor service in node rather than electron. Starting in typescript 4.6, it appears that the tsserver-bridge workaround no longer works.
Error when using tsserver-bridge:
Unfortunately, tsserver-bridge is no longer supported (author thinks it is no longer required since you can adjust heap size, but electron limits heap size because it implements pointer compression).
Electron has been so far unwilling to provide builds that disable pointer compression, and even if they did, vscode would need to begin leveraging it.
🔎 Search Terms
tsserver-bridge, heap limit, memory limit, process.send
🕗 Version & Regression Information
🙁 Actual behavior
Large mono repos hit the memory limit and tsserver-bridge is not a workaround
🙂 Expected behavior
Allow tsserver-bridge to work or get off of electron
The text was updated successfully, but these errors were encountered: