microsoft / vscode

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

TS Server fatal error: Debug Failure. False expression: Script kind should match provided ScriptKind:4 and sourceFile.scriptKind: 3, !entry: false #192118

Closed p6l-richard closed 11 months ago

p6l-richard commented 1 year ago

We have written the needed data into your clipboard because it was too large to send. Please paste.

Type: Bug

❗️❗️❗️ Please fill in the sections below to help us diagnose the issue ❗️❗️❗️

TypeScript Version: 5.1.0-dev.20230509

Steps to reproduce crash

1. 2. 3.

TS Server Log

❗️ Server logging disabled. To help us fix crashes like this, please enable logging by setting:

"typescript.tsserver.log": "verbose"

After enabling this setting, future crash reports will include the server log.

TS Server Error Stack

Server: syntax

Error: Debug Failure. False expression: Script kind should match provided ScriptKind:4 and sourceFile.scriptKind: 3, !entry: false
    at getDocumentRegistryEntry (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:133014:11)
    at Object.releaseDocumentWithKey (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:133111:19)
    at getOrCreateSourceFileByPath (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:141789:30)
    at Object.getOrCreateSourceFile (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:141773:14)
    at /private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:141705:42
    at Object.getSourceFileWithCache [as getSourceFile] (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:117879:24)
    at findSourceFileWorker (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:120247:23)
    at findSourceFile (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:120167:20)
    at /private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:120116:22
    at getSourceFileFromReferenceWorker (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:120100:69)
    at processSourceFile (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:120114:5)
    at processRootFile (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119911:5)
    at /private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118690:41
    at forEach (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:2324:22)
    at createProgram (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118690:5)
    at synchronizeHostData (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:141729:15)
    at Object.getProgram (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:141801:5)
    at InferredProject2.updateGraphWorker (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:174359:41)
    at InferredProject2.updateGraph (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:174211:32)
    at _ProjectService.assignOrphanScriptInfoToInferredProject (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:176601:13)
    at _ProjectService.assignProjectToOpenedScriptInfo (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:178219:12)
    at /private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:178449:64
    at flatMap (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:2572:17)
    at _ProjectService.applyChangesInOpenFiles (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:178449:24)
    at updateOpen (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:179629:29)
    at /private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:182201:69
    at IpcIOSession.executeWithRequestId (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:182193:14)
    at IpcIOSession.executeCommand (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:182201:29)
    at IpcIOSession.onMessage (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:182243:51)
    at process.<anonymous> (/private/var/folders/6d/7ntd0w_573x7pphtvs98_56c0000gn/T/AppTranslocation/A0CB9508-5A74-4FB0-BAB2-8C625DA32189/d/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:183823:14)
    at process.emit (node:events:513:28)
    at emit (node:internal/child_process:958:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:84:21)

VS Code version: Code - Insiders 1.79.0-insider (Universal) (02298ef4180f2a5db39e0cb6288382860b96a596, 2023-05-11T05:26:00.234Z) OS version: Darwin arm64 21.6.0 Modes: Sandboxed: Yes

System Info |Item|Value| |---|---| |CPUs|Apple M1 (8 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|8, 13, 8| |Memory (System)|8.00GB (0.19GB free)| |Process Argv|--crash-reporter-id e7eddbe9-6db1-4cdb-9bab-46d6c91329cc| |Screen Reader|no| |VM|0%|
Extensions (15) Extension|Author (truncated)|Version ---|---|--- vscode-tailwindcss|bra|0.10.0 vscode-markdownlint|Dav|0.51.0 vscode-eslint|dba|2.4.2 rest-client-api|don|0.25.3 prettier-vscode|esb|10.1.0 copilot|Git|1.108.382 copilot-chat|Git|0.3.2023060801 vscode-github-actions|git|0.26.1 vscode-dotnet-runtime|ms-|1.7.2 phind|phi|0.4.4 prisma|Pri|5.2.0 vscode-thunder-client|ran|2.9.2 project-snippets|reb|0.5.0 vscode-stripe|str|2.0.14 markdown-all-in-one|yzh|3.5.1
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythontb:30258533 pythonptprofiler:30281269 vshan820:30294714 vscod805cf:30301675 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30404738 py29gd2263:30784851 vsclangdf:30492506 c4g48928:30535728 dsvsc012:30540252 pynewext54:30618038 showlangstatbar:30737417 ecj1e332:30687743 pythonfmttext:30716741 fixshowwlkth:30771523 showindicator:30805243 pythongtdpath:30726887 i26e3531:30792625 welcomedialog:30812478 pythonnosmt12:30779711 pythonidxpt:30768918 pythonnoceb:30776497 copilotsettingc:30808720 dsvsc013:30777762 dsvsc014:30777825 diffeditorv2:30786206 pythonlinttypecf:30823782 pythonmpsinfo:30815194 dsvsc015:30821418 pythontestfixt:30826906 pythonfb280951:30826785 ```
mjbvz commented 11 months ago

To help us investigate this, 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

vscodenpa commented 11 months ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!