Skip to content

TypeScript server won't start on WSL #36243

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

Closed
alexpaluzzi opened this issue Jan 16, 2020 · 10 comments · Fixed by #39243
Closed

TypeScript server won't start on WSL #36243

alexpaluzzi opened this issue Jan 16, 2020 · 10 comments · Fixed by #39243
Assignees
Labels
Fix Available A PR has been opened for this issue

Comments

@alexpaluzzi
Copy link

Issue Type: Bug

Open a large repo and then open any .js or .ts file. No intellisense.

All extensions (except WSL remote) disabled. Tried with latest TS. It DOES work if the project files are not in WSL2. Possibly related to Remote - WSL extension?

VS Code version: Code 1.41.1 (26076a4de974ead31f97692a0d32f90d735645c0, 2019-12-18T14:58:56.166Z)
OS version: Windows_NT x64 10.0.19041
Remote OS version: Linux x64 4.19.84-microsoft-standard

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 x 3600)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.93GB (1.13GB free)
Process Argv
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 4.19.84-microsoft-standard
CPUs Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 x 3600)
Memory (System) 25.01GB (2.04GB free)
VM 0%
Extensions (3)
Extension Author (truncated) Version
remote-wsl ms- 0.41.7
prettier-vscode esb 3.18.0
vscode-typescript-next ms- 3.8.20200115
@alexpaluzzi
Copy link
Author

After opening and watching "Initializing js/ts server...". I verbose logging shows a whole mess of stuff, happy to put it all here if needed.
Some that stick out:

[Trace - 19:30:30.496] Response received: updateOpen (2). Request took 137986 ms. Success: true

This took over 2 minutes.

[Trace - 19:30:31.120] Response received: getSupportedCodeFixes (3). Request took 138609 ms. Success: true

This took another 2 minutes.

[Trace - 19:30:37.291] Response received: configure (4). Request took 144779 ms. Success: true

Another 2+ minutes.

Then it just kind of hangs. I noticed when I try to force some intellisense (with ctrl+space) I see these errors:

[Error  - 19:35:46.867] ReaderError
RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be an integer. Received NaN
	at Function.concat (buffer.js:449:5)
	at l.append (/home/alex/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/extensions/typescript-language-features/dist/extension.js:1:210613)
	at t.Reader.onLengthData (/home/alex/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/extensions/typescript-language-features/dist/extension.js:1:211680)
	at Socket.<anonymous> (/home/alex/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/extensions/typescript-language-features/dist/extension.js:1:211607)
	at Socket.emit (events.js:200:13)
	at addChunk (_stream_readable.js:294:12)
	at readableAddChunk (_stream_readable.js:275:11)
	at Socket.Readable.push (_stream_readable.js:210:10)
	at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)

I also just started getting this pop-up too:

image

No idea if it's related but it's new all of the sudden. My max user watches are already 524288 (there are not nearly that many files in this project, not including node_modules) but I'm not ruling out some serious WSL2 weirdness here.

@mjbvz mjbvz self-assigned this Jan 16, 2020
@mjbvz mjbvz transferred this issue from microsoft/vscode Jan 16, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Jan 16, 2020

Seems like #33335

@mjbvz mjbvz changed the title TypeScript server won't start TypeScript server won't start on WSL Jan 16, 2020
@alexpaluzzi
Copy link
Author

alexpaluzzi commented Jan 16, 2020

Possibly-- but it just started recently. And I DO have the files in the native WSL2 system (where they are recommended to go and things are generally blazing fast from there).

I really would like to exclude all node_modules folders from any kind in the project. No tweaking of the file_watcher settings seems to work effectively. There are probably 500+ node_modules folders in this project that I have open here.

@alexpaluzzi
Copy link
Author

@mjbvz even trying to completely disable the filewatcher.

image

This Vmmem process is taking almost all of my memory (!!28GB+) and about ~40-50% CPU until I start getting errors. Even after the errors come, the CPU usage drops to about 10% but it doesn't let go of the memory (even after closing Code). The CPU drops to ~0% after I close it, though.

It doesn't let go of the whopping 28GB of memory until I literally shutdown the WSL2 VM with wsl --shutdown. If I open Code again with this project, I get the "Initializing JS/TS language features" and watch this Vmmem process climb and climb until I run out of RAM and it fails.

@alexpaluzzi
Copy link
Author

alexpaluzzi commented Jan 16, 2020

There is something seriously wrong with how my project opens here in WSL2 and Code. I was able to reproduce this on an entirely different machine.

To give an idea of what my project looks like:

node_modules
folderA
  node_modules
src
  folderB
    folderB1
      node_modules
    folderB2
      node_modules

There are about 500+ folderB(n). All with their own node_modules folder. The joyous world of "serverless".

@alexpaluzzi
Copy link
Author

alexpaluzzi commented Jan 17, 2020

Digging in more, it definitely looks related to the file watchers. No matter what kind of globbing I can come up with, I can't get Code to ignore all node_modules folders recursively.

@alexpaluzzi
Copy link
Author

Continuing my search, I strongly believe this is related to: microsoft/WSL#4166.

@mjbvz mjbvz removed their assignment Jan 21, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Jan 21, 2020

@sheetalkamat Should @alexpaluzzi try changing to use a different file watching strategy to see if that helps?

@sheetalkamat
Copy link
Member

I dont know think it would help since editor watches node_modules directory instead of actual script infos. I think the issue is similar to #33335. We would need more options to ignore directories for watch to handle this.

@alexpaluzzi
Copy link
Author

@sheetalkamat that certainly seems like it. It doesn't look like it's possible today to have this directory open with WSL2 in Code unfortunately.

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Feb 6, 2020
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.0 milestone Feb 6, 2020
@sheetalkamat sheetalkamat added Fix Available A PR has been opened for this issue and removed Needs Investigation This issue needs a team member to investigate its status. labels Jun 24, 2020
@sheetalkamat sheetalkamat linked a pull request Jun 25, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants