microsoft / microsoft/TypeScript

Initializing tsconfig.json hangs

Đang mở
#62,960 8 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Needs More Info
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

### 🔎 Search Terms

initializing tsconfig.json

### 🕗 Version & Regression Information

I use typescript 5.9.3 and have not tested other versions.

### ⏯ Playground Link

_No response_

### 💻 Code

### 🙁 Actual behavior

1. Start VS Code
2. Open a Vue project
3. Open any .vue file
4. Initializing 'tsconfig.json' is displayed on the status bar
5. Compilation / syntax errors are not displayed.
6. It is not possible to use auto completion / intellisense
7. Pressing CTRL-Space just shows "Loading"1.

### 🙂 Expected behavior

For an open .vue file
* Any compilation / syntax errors are displayed.
* It is possible to use auto completion / intellisense (automatically or via CTRL-Space)

### Additional information about the issue

Recently my VS Code seems to have a problem initializing my VueJs workspaces. The problem seems to be related to the TSServer. That's why I create the issue here.

When a .vue file is opened VS Code displays "Initializing 'tsconfig.json'" in the status bar in the lower left-hand corner and it takes at least 20 minute if it finishes at all. Because of this all intellisense features (code completion, error display) do not work as well.

Most of my VueJS workspaces are on a network share and the issue occurs with all of them. The issue does not occur with workspaces on the local hard drive. The issue does not occur on another computer (same extensions, same version of VS Code) where the initialization is finished in less than a minute.

I tried deleting the config folders in my profile (.vscode and AppData\Roaming\Code) and just installing the official Vue extension, but the problem persists. I tried installing VS Code from scratch as well without success.

I compared the tsserver logs of the working and not working computer. While the log messages themselves are more or less identical the computer showing the issues seems to pause the initialization for a couple of seconds once in while:

Working computer:

```
Info 99 [12:22:26.419] FileWatcher:: Added:: WatchInfo: c:/Users/user/.vscode/extensions/vue.volar-3.2.1/types/props-fallback.d.ts 500 undefined WatchType: Closed Script info
Info 100 [12:22:26.420] event:
{"seq":0,"type":"event","event":"createFileWatcher","body":{"id":30,"path":"c:/Users/user/.vscode/extensions/vue.volar-3.2.1/types/props-fallback.d.ts"}}
Info 101 [12:22:26.863] FileWatcher:: Added:: WatchInfo: //server.tld/web_projects/admin/src/locales/de.json 500 undefined WatchType: Closed Script info
Info 102 [12:22:26.863] event:
{"seq":0,"type":"event","event":"createFileWatcher","body":{"id":31,"path":"//server.tld/web_projects/admin/src/locales/de.json"}}
```

Not-working computer:

```
Info 99 [12:33:33.274] FileWatcher:: Added:: WatchInfo: c:/Users/user/.vscode/extensions/vue.volar-3.2.1/types/props-fallback.d.ts 500 undefined WatchType: Closed Script info
Info 100 [12:33:33.274] event:
{"seq":0,"type":"event","event":"createFileWatcher","body":{"id":30,"path":"c:/Users/user/.vscode/extensions/vue.volar-3.2.1/types/props-fallback.d.ts"}}
Info 101 [12:34:09.092] FileWatcher:: Added:: WatchInfo: //server.tld/web_projects/admin/src/locales/de.json 500 undefined WatchType: Closed Script info
Info 102 [12:34:09.092] event:
{"seq":0,"type":"event","event":"createFileWatcher","body":{"id":31,"path":"//server.tld/web_projects/admin/src/locales/de.json"}}
```

Why is there a pause of 36 seconds? I found other event longer pauses of 3 min, 33 secondes, 35 seconds, 3 min 17 seconds, e.g.:

```
Info 640 [12:38:18.840] FileWatcher:: Added:: WatchInfo: \\server.tld\web_projekte\admin\node_modules\vue-i18n\package.json 2000 {"excludeDirectories":["//server.tld/web_projekte/admin/node_modules","//server.tld/web_projekte/admin/**/node_modules","//server.tld/web_projekte/admin/dist","//server.tld0/web_projekte/admin/**/dist"]} Project: /dev/null/autoImportProviderProject1* WatchType: File location affecting resolution
Info 641 [12:41:35.474] FileWatcher:: Added:: WatchInfo: \\server.tld\web_projekte\node_modules\@types\node\package.json 2000 {"excludeDirectories":["//server.tld/web_projekte/admin/node_modules","//server.tld/web_projekte/admin/**/node_modules","//server.tld/web_projekte/admin/dist","//server.tld/web_projekte/admin/**/dist"]} Project: /dev/null/autoImportProviderProject1* WatchType: File location affecting resolution
```

On the other computer the pause is slightly over 1 second.

When I restart the TS server the delays seem to occur on the same log entries with the same duration.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với các log của tsserver và các mục khởi tạo của file-watcher, đặc biệt là những lần tạm dừng khi theo dõi các tệp trên network share và autoImportProviderProject1. So sánh các đường dẫn khởi tạo hoạt động và không hoạt động; được xem là hoàn tất khi các workspace Vue trên network share hoàn tất khởi tạo mà không bị tạm dừng kéo dài và khôi phục diagnostics cùng IntelliSense.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript, vscode
Lĩnh vực
developer-experience, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.