microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.61k stars 28.14k forks source link

Error when trying to include TS in existing project #179220

Closed saulens22 closed 1 year ago

saulens22 commented 1 year ago

Type: Bug

Project uses: Laravel, Vite, Vue2, Tailwind, AlpineJS

VS Code version: Code 1.77.0 (7f329fe6c66b0f86ae1574c2911b681ad5a45d63, 2023-03-29T10:02:16.981Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 4600H with Radeon Graphics (12 x 2994)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|31.42GB (9.17GB free)| |Process Argv|--crash-reporter-id 2e051a8a-37fd-4fda-8a8c-d2500490f99e| |Screen Reader|no| |VM|33%| |Item|Value| |---|---| |Remote|WSL: Debian| |OS|Linux x64 5.15.90.1-microsoft-standard-WSL2| |CPUs|AMD Ryzen 5 4600H with Radeon Graphics (12 x 2994)| |Memory (System)|15.34GB (7.96GB free)| |VM|0%|
Extensions (56) Extension|Author (truncated)|Version ---|---|--- project-manager|ale|12.7.0 postcss|css|1.0.9 codespaces|Git|1.14.3 remotehub|Git|0.54.0 dotenv|mik|1.0.1 remote-containers|ms-|0.288.0 remote-ssh|ms-|0.98.0 remote-ssh-edit|ms-|0.84.0 remote-wsl|ms-|0.77.0 vscode-remote-extensionpack|ms-|0.24.0 remote-explorer|ms-|0.4.0 remote-repositories|ms-|0.32.0 remote-server|ms-|1.0.0 php-docblocker|nei|2.7.0 laravel5-snippets|one|1.17.0 alpine-js-intellisense|adr|1.2.0 project-manager|ale|12.7.0 beautify-blade|api|1.0.1 vscode-intelephense-client|bme|1.9.5 vscode-tailwindcss|bra|0.9.11 npm-intellisense|chr|1.4.4 livewire-vscode|cie|0.2.8 gitignore|cod|0.9.0 laravel-goto-view|cod|1.3.8 vscode-eslint|dba|2.4.0 composer-php-vscode|DEV|1.32.12895 git-extension-pack|don|0.1.3 githistory|don|0.6.20 gitlens|eam|13.4.0 EditorConfig|Edi|0.16.4 tall-stack|ent|1.0.9 copilot|Git|1.79.10634 copilot-labs|Git|0.12.791 vscode-github-actions|git|0.25.3 vscode-pull-request-github|Git|0.62.0 todo-tree|Gru|0.0.224 headwind|hey|1.7.0 vscode-git-tags|how|1.4.4 laravel-blade-wrapper|IHu|1.0.1 php-namespace-resolver|Meh|1.1.9 git-graph|mhu|1.30.0 code-beautifier|mic|2.3.3 dotenv|mik|1.0.1 sqltools|mtx|0.27.1 laravel-goto-components|nao|1.2.0 php-docblocker|nei|2.7.0 laravel-blade|one|1.34.0 laravel-extension-pack|one|1.1.0 laravel5-snippets|one|1.17.0 vs-code-prettier-eslint|rve|5.1.0 laravel-artisan|rya|0.0.28 vscode-blade-formatter|shu|0.20.14 vscode-wakatime|Wak|24.0.7 php-debug|xde|1.32.1 php-pack|xde|1.0.3 vscode-open-in-github|ziy|1.3.6
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyone:30548225 vsccc:30610678 nodejswelcome1:30587005 3biah626:30602489 pyind779:30671433 f6dab269:30613381 vscrp:30673768 pythonsymbol12:30671437 6233i204:30672705 vsccsb:30705552 azdwalk:30687957 pythonms35:30701012 pythonclientmv:30705673 ```
IllusionMH commented 1 year ago

/needsMoreInfo

What error and what code causes it?

VSCodeTriageBot commented 1 year ago

Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.

Happy Coding!

saulens22 commented 1 year ago

Error occurs when I try to create new or open existing .ts or .js file.

I get this error:

The JS/TS language service immediately crashed 5 times. The service will not be restarted. This may be caused by a plugin contributed by one of these extensions: VisualStudioExptTeam.vscodeintellicode, VisualStudioExptTeam.vscodeintellicode. Please try disabling these extensions before filing an issue against VS Code.

When I disable these extensions, I get the same error, but with option to report issue.

TSServer trace ``` [Info - 12:05:04.179] Starting TS Server [Info - 12:05:04.180] Using tsserver from: /home/user/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63/extensions/node_modules/typescript/lib/tsserver.js [Info - 12:05:04.226] Forking... [Info - 12:05:04.241] Starting... [Info - 12:05:04.242] Forking... [Info - 12:05:04.264] Starting... [Trace - 12:05:04.269] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:04.269] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:04.270] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 Arguments: { "options": { "module": "ESNext", "moduleResolution": "Node", "target": "ES2020", "jsx": "react", "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } [Trace - 12:05:04.278] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Trace - 12:05:04.278] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Trace - 12:05:04.474] Canceled request with sequence number 2 [Error - 12:05:04.614] TSServer exited. Code: 1. Signal: null [Info - 12:05:04.615] Starting TS Server [Info - 12:05:04.615] Using tsserver from: /home/user/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63/extensions/node_modules/typescript/lib/tsserver.js [Info - 12:05:04.615] Forking... [Info - 12:05:04.630] Starting... [Info - 12:05:04.631] Forking... [Info - 12:05:04.646] Starting... [Trace - 12:05:04.650] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:04.650] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:04.650] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 Arguments: { "options": { "module": "ESNext", "moduleResolution": "Node", "target": "ES2020", "jsx": "react", "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } [Trace - 12:05:04.744] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Trace - 12:05:04.744] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Error - 12:05:04.971] TSServer exited. Code: 1. Signal: null [Info - 12:05:04.972] Starting TS Server [Info - 12:05:04.972] Using tsserver from: /home/user/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63/extensions/node_modules/typescript/lib/tsserver.js [Info - 12:05:04.972] Forking... [Info - 12:05:04.988] Starting... [Info - 12:05:04.988] Forking... [Info - 12:05:05.3] Starting... [Trace - 12:05:05.5] Canceled request with sequence number 4 [Trace - 12:05:05.5] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:05.5] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:05.6] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 Arguments: { "options": { "module": "ESNext", "moduleResolution": "Node", "target": "ES2020", "jsx": "react", "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } [Trace - 12:05:05.9] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Trace - 12:05:05.10] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Error - 12:05:05.294] TSServer exited. Code: 1. Signal: null [Info - 12:05:05.295] Starting TS Server [Info - 12:05:05.295] Using tsserver from: /home/user/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63/extensions/node_modules/typescript/lib/tsserver.js [Info - 12:05:05.295] Forking... [Info - 12:05:05.311] Starting... [Info - 12:05:05.312] Forking... [Info - 12:05:05.326] Starting... [Trace - 12:05:05.328] Canceled request with sequence number 3 [Trace - 12:05:05.328] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:05.328] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:05.328] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 Arguments: { "options": { "module": "ESNext", "moduleResolution": "Node", "target": "ES2020", "jsx": "react", "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } [Trace - 12:05:05.530] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Trace - 12:05:05.530] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Error - 12:05:05.632] TSServer exited. Code: 1. Signal: null [Info - 12:05:05.632] Starting TS Server [Info - 12:05:05.632] Using tsserver from: /home/user/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63/extensions/node_modules/typescript/lib/tsserver.js [Info - 12:05:05.633] Forking... [Info - 12:05:05.648] Starting... [Info - 12:05:05.649] Forking... [Info - 12:05:05.664] Starting... [Trace - 12:05:05.666] Canceled request with sequence number 3 [Trace - 12:05:05.666] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:05.666] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:05.667] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 Arguments: { "options": { "module": "ESNext", "moduleResolution": "Node", "target": "ES2020", "jsx": "react", "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } [Trace - 12:05:05.870] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Trace - 12:05:05.870] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Error - 12:05:05.951] TSServer exited. Code: 1. Signal: null [Info - 12:05:05.952] Starting TS Server [Info - 12:05:05.952] Using tsserver from: /home/user/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63/extensions/node_modules/typescript/lib/tsserver.js [Info - 12:05:05.952] Forking... [Info - 12:05:05.969] Starting... [Info - 12:05:05.970] Forking... [Info - 12:05:05.988] Starting... [Trace - 12:05:05.989] Canceled request with sequence number 3 [Trace - 12:05:05.989] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:05.989] Sending request: configure (0). Response expected: no. Current queue length: 0 Arguments: { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto" }, "watchOptions": {} } [Trace - 12:05:05.989] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 Arguments: { "options": { "module": "ESNext", "moduleResolution": "Node", "target": "ES2020", "jsx": "react", "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } [Trace - 12:05:06.191] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Trace - 12:05:06.191] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 Arguments: { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "/home/user/myproject/resources/ts/app-typescript.ts", "fileContent": "", "projectRootPath": "/home/user/myproject", "scriptKindName": "TS" } ] } [Error - 12:05:06.328] TSServer exited. Code: 1. Signal: null [Trace - 12:05:22.826] Canceled request with sequence number 3 ```
mjbvz commented 1 year ago

Please try collecting the TS Server log from the crashed instance:

  1. Set "typescript.tsserver.log": "verbose"
  2. Restart VS Code and reproduce the problem
  3. Open the TypeScript section of the output panel
  4. At the very top, find the first line that prints to path to the semantic error log file. It should look something like:

    [Info  - 19:54:59.247] <semantic> Log file: /Users/matb/Library/Application Support/Code - Insiders/logs/20200213T104930/exthost55/vscode.typescript-language-features/tsserver-log-ZT2zau/tsserver.log

    That file contains the typescript logs.

Look through that log file for the first error or stack trace you see. If you can share the log, I can also take a look to see if anything stands out

⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

saulens22 commented 1 year ago

I've included the trace in last message.

Don't know what the problem was, but deleting /home/user/.vscode-server in WSL and reinstalling extensions fixed the problem.