microsoft / vscode

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

TS Server fatal error: Cannot read properties of undefined (reading 'charCount') #201396

Closed satyajeetvsd closed 7 months ago

satyajeetvsd commented 9 months ago

Type: Bug

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

TypeScript Version: 5.3.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

TypeError: Cannot read properties of undefined (reading 'charCount')
    at _LineNode.walk (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:186098:52)
    at _LineIndex.edit (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:185990:17)
    at _ScriptVersionCache._getSnapshot (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:185796:31)
    at _ScriptVersionCache.getSnapshot (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:185789:17)
    at _ScriptVersionCache.edit (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:185785:12)
    at TextStorage.edit (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:175811:39)
    at ScriptInfo.editContent (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:176197:22)
    at _ProjectService.applyChangesToFile (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:181593:18)
    at _ProjectService.applyChangesInOpenFiles (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:181563:14)
    at updateOpen (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:182775:29)
    at c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:185377:69
    at IpcIOSession.executeWithRequestId (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:185369:14)
    at IpcIOSession.executeCommand (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:185377:29)
    at IpcIOSession.onMessage (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:185419:51)
    at process.<anonymous> (c:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:187001: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.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:49:37.021Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz (4 x 2496)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.88GB (6.31GB free)| |Process Argv|--crash-reporter-id 684a693d-0a6d-435b-8e60-9260fcb42880| |Screen Reader|no| |VM|0%|
Extensions (32) Extension|Author (truncated)|Version ---|---|--- jquery-snippets|Abh|1.0.4 vscode-javascript-snippet-pack|aka|0.1.6 save-typing|akh|0.1.0 laravel-extra-intellisense|ami|0.6.4 bootstrap5-vscode|Anb|0.4.4 vscode-intelephense-client|bme|1.10.2 vscode-standardjs-snippets|cap|0.9.0 laravel-goto-view|cod|1.3.11 vscode-autosave|cod|1.2.3 bracket-pair-colorizer-2|Coe|0.2.4 jquerysnippets|don|0.0.1 es7-react-js-snippets|dsz|4.4.3 gitlens|eam|14.6.1 vscode-html-css|ecm|1.13.1 prettier-vscode|esb|10.1.0 auto-close-tag|for|0.5.15 JavaScriptSnippetsStandard|jms|1.8.0 auto-save|mcr|1.0.3 notepadplusplus-keybindings|ms-|1.0.7 nojquery-snippets|Nkz|0.1.3 laravel-blade|one|1.34.0 vscode-thunder-client|ran|2.16.3 LiveServer|rit|5.7.9 laravel-artisan|rya|0.0.31 vscode-blade-formatter|shu|0.23.5 JavaScriptSnippets|xab|1.8.0 ReactSnippets|xab|2.4.0 php-debug|xde|1.34.0 php-pack|xde|1.0.3 chat-gpt|zha|1.6.62 html-css-class-completion|Zig|1.20.0 php-intellisense|zob|1.3.3
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263cf:30335440 vscorecescf:30445987 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263:30899288 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyone:30548225 2e4cg342:30602488 f6dab269:30613381 a9j8j154:30646983 showlangstatbar:30737416 0bi6i642:30917235 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30902429 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 cp7184c:30925681 ```
mjbvz commented 7 months ago

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

If so, please share a project which causes the issue or try collecting the full TS Server logs

VSCodeTriageBot commented 7 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!