microsoft / vscode

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

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

Closed pppest closed 1 year ago

pppest commented 1 year ago

Type: Bug

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

TypeScript Version: 5.2.2

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:3 and sourceFile.scriptKind: 4, !entry: false
    at getDocumentRegistryEntry (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:134950:11)
    at acquireOrUpdateDocument (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:134978:32)
    at Object.acquireDocumentWithKey (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:134916:12)
    at getOrCreateSourceFileByPath (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:143973:31)
    at Object.getOrCreateSourceFile (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:143952:14)
    at /opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:143876:42
    at Object.getSourceFileWithCache [as getSourceFile] (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:119693:24)
    at findSourceFileWorker (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:122097:23)
    at findSourceFile (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:122017:20)
    at /opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:121966:22
    at getSourceFileFromReferenceWorker (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:121950:69)
    at processSourceFile (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:121964:5)
    at processRootFile (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:121761:5)
    at /opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:120508:41
    at forEach (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:2352:22)
    at createProgram (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:120508:5)
    at synchronizeHostData (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:143907:15)
    at Object.getProgram (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:143981:5)
    at InferredProject2.updateGraphWorker (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:176966:41)
    at InferredProject2.updateGraph (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:176817:32)
    at _ProjectService.assignOrphanScriptInfoToInferredProject (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:179213:13)
    at _ProjectService.assignProjectToOpenedScriptInfo (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:180832:12)
    at /opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:181062:64
    at flatMap (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:2600:17)
    at _ProjectService.applyChangesInOpenFiles (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:181062:24)
    at updateOpen (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:182242:29)
    at /opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:184838:69
    at IpcIOSession.executeWithRequestId (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:184830:14)
    at IpcIOSession.executeCommand (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:184838:29)
    at IpcIOSession.onMessage (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:184880:51)
    at process.<anonymous> (/opt/visual-studio-code/resources/app/extensions/node_modules/typescript/lib/tsserver.js:186461:14)
    at process.emit (node:events:513:28)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

VS Code version: Code 1.82.2 (abd2f3db4bdb28f9e95536dfa84d8479f1eb312d, 2023-09-14T05:51:20.981Z) OS version: Linux x64 6.5.1-1-MANJARO Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 PRO 5650U with Radeon Graphics (12 x 2276)| |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
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|4, 4, 3| |Memory (System)|30.19GB (13.59GB free)| |Process Argv|--unity-launch --crash-reporter-id 91daf4d8-f07c-4874-a7dd-5d94739c076f| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|gnome-xorg| |XDG_CURRENT_DESKTOP|GNOME| |XDG_SESSION_DESKTOP|gnome-xorg| |XDG_SESSION_TYPE|x11|
Extensions (31) Extension|Author (truncated)|Version ---|---|--- vscode-icontheme-nomo-dark|be5|1.3.6 vscode-tailwindcss|bra|0.10.0 vscode-jetbrains-icon-theme|cha|2.10.0 vscode-eslint|dba|2.4.2 vscode-notes|dio|1.1.0 es7-react-js-snippets|dsz|4.4.3 vsc-material-theme-icons|equ|3.0.4 prettier-vscode|esb|10.1.0 figma-vscode-extension|fig|0.2.7 copilot|Git|1.115.430 copilot-chat|Git|0.7.1 copilot-labs|Git|0.15.1019 vscode-github-actions|git|0.26.2 vscode-drawio|hed|1.6.6 solidity|Jua|0.0.165 pomodoro|lky|1.1.3 git-graph|mhu|1.30.0 symbols|mig|0.0.14 vscode-docker|ms-|1.26.1 playwright|ms-|1.0.15 black-formatter|ms-|2023.4.1 python|ms-|2023.16.0 vscode-pylance|ms-|2023.9.20 remote-containers|ms-|0.309.0 makefile-tools|ms-|0.7.0 material-icon-theme|PKi|4.30.1 postman-for-vscode|Pos|0.9.1 docxreader|Sha|1.1.3 code-spell-checker|str|3.0.1 pdf|tom|1.2.2 material-theme|zhu|3.16.0 (4 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263cf:30792227 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 3biah626:30602489 89544117:30613380 a9j8j154:30646983 showlangstatbar:30737416 03d35959:30757346 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 pythonnosmt12:30797651 pythonidxpt:30805730 pythonnoceb:30805159 copilotsettingc:30839828 dsvsc013:30795093 dsvsc014:30804076 diffeditorv2:30821572 dsvsc015cf:30829746 ```
gjsjohnmurray commented 1 year ago

/duplicate of #193902

vscodenpa commented 1 year ago

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!