-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Initializing JS/TS Features is extremely slow with WSL and node_modules #33335
Comments
Email with scrubbed |
Thanks! The line
explains why this is taking so long. I'm moving this issue upstream to TS but it could be a wsl issue as well. |
Seems like the node_modules directory is big and because Linux doesn't support recursive directory watching we have to traverse whole directory and create those watches to handle the situation. Note that even if we did not watch node_modules here for closed script infos that are part of the project, we wont be able to avoid this as we would need to watch node_modules for the failed lookups during module resolution..
|
@sheetalkamat let's chat about this one sometime. Curious what you think our next steps should be |
Running into the same issue under WSL using either typescript or typescript@next. Host OS: 1809 (17763.615) tsserver is being polled via tsuquyomi in vim 8.1. Project load with typescript: Elapsed:: 850708ms ~14m I noticed that instead of scanning just the include directory specified in tsconfig.json and node_modules it's also scanning the entire root for files. Log indicates it has watches scattered across ProgramData, Program Files, Users, Windows, and even extending to setting up watchers for external drives via /mnt/f. Performance is fine once initial load completes. Also appears to be ignoring the tsconfig entirely as the logs list all project files under inferredProject1 and 0 files under the project for tsconfig.json. Doesn't appear to be intended behaviour according to the wiki. This is a small project with only 66 files, ~3500 lines of ts/tsx files and 193 MiB of node modules so shouldn't be taking anywhere near this long to load. All project files are located in subdirectories of C:\Projects / /mnt/c/Projects. Happy to provide logs privately if required, for both 3.6.3 and 3.7.0-dev. |
Seeing the same issue here on WSL2.
I've also created microsoft/vscode#87921 before finding this issue, might be more information there. |
This issue is probably also exacerbated on WSL2 by microsoft/WSL#4197 Putting the files on the native linux filesystem of wsl (on ext4) instead of getting to them through NTFS does improve things GREATLY:
|
I am having the slow initialization problem. |
Needs |
Dont host mount stuff into wsl. Always operate completely within wsl. vscode-wsl extension makes this trivial |
template info added by @mjbvz
TypeScript Version: 3.6.2
Search Terms
Original report below
From my testing - this issue seems to only be related to WSL (maybe 2.0) and
node_modules
together.In Insiders v1.39.0 on a fresh install there were no issues on a specified project of mine (about 1GB, 60MB
node_modules
), as well as a smaller project (nonode_modules
, only about 15MB).Once loaded into WSL with
Remote WSL
extension, a small project (nonode_modules
, only about 15MB) worked perfectly. The same first project (about 1GB, 60MBnode_modules
), didn't load (over 15 minutes).EDIT: It ended up working after 29 minutes. I can maybe share the entire
tsserver.log
privately (once I scrub it) if needed.The text was updated successfully, but these errors were encountered: