microsoft / vscode

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

TS Server fatal error: Debug Failure. Invalid cast. The supplied value [object Object] did not pass the test 'isUnaryExpression'. #179501

Closed SohelIslamImran closed 1 year ago

SohelIslamImran commented 1 year ago

Type: Bug

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

TypeScript Version: 5.0.2

Steps to reproduce crash

  1. When Open the app

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: semantic

Error: Debug Failure. Invalid cast. The supplied value [object Object] did not pass the test 'isUnaryExpression'.
    at cast (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:3443:16)
    at Object.parenthesizeOperandOfPrefixUnary (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:21786:50)
    at Object.createPrefixUnaryExpression (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:23915:41)
    at parsePrefixUnaryExpression (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:33520:32)
    at parseSimpleUnaryExpression (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:33572:16)
    at parseUnaryExpressionOrHigher (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:33554:35)
    at parseBinaryExpressionOrHigher (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:33472:25)
    at parseAssignmentExpressionOrHigher (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:33145:18)
    at parseExpression (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:33111:16)
    at doOutsideOfContext (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:30808:12)
    at allowInAnd (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:30829:12)
    at parseExpressionOrLabeledStatement (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:34623:24)
    at parseStatement (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:34855:12)
    at parseListElement (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:31579:12)
    at parseList (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:31564:19)
    at parseBlock (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:34374:26)
    at parseStatement (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:34769:16)
    at parseListElement (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:31579:12)
    at parseList (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:31564:19)
    at parseBlock (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:34374:26)
    at parseStatement (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:34769:16)
    at parseListElement (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:31579:12)
    at parseList (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:31564:19)
    at parseBlock (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:34374:26)
    at parseStatement (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:34769:16)
    at parseListElement (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:31579:12)
    at parseList (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:31564:19)
    at parseSourceFileWorker (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:30624:24)
    at Object.parseSourceFile (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:30457:20)
    at createSourceFile (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:30290:21)
    at createLanguageServiceSourceFile (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:135139:22)
    at acquireOrUpdateDocument (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:132053:26)
    at Object.acquireDocumentWithKey (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:131978:12)
    at getOrCreateSourceFileByPath (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:135464:31)
    at Object.getOrCreateSourceFile (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:135444:14)
    at c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:135376:42
    at Object.getSourceFileWithCache [as getSourceFile] (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:117127:24)
    at findSourceFileWorker (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:119460:23)
    at findSourceFile (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:119380:20)
    at c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:119329:22
    at getSourceFileFromReferenceWorker (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:119298:26)
    at processSourceFile (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:119327:5)
    at processRootFile (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:119123:5)
    at c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:117908:41
    at forEach (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:2307:22)
    at createProgram (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:117908:5)
    at synchronizeHostData (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:135400:15)
    at Object.getProgram (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:135472:5)
    at ConfiguredProject2.updateGraphWorker (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:172153:41)
    at ConfiguredProject2.updateGraph (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:172090:32)
    at ConfiguredProject2.updateGraph (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:173272:24)
    at _ProjectService.createLoadAndUpdateConfiguredProject (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:174879:13)
    at _ProjectService.assignProjectToOpenedScriptInfo (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:175970:26)
    at c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:176250:64
    at flatMap (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:2555:17)
    at _ProjectService.applyChangesInOpenFiles (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:176250:24)
    at updateOpen (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:177395:29)
    at c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:179962:69
    at IpcIOSession.executeWithRequestId (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:179954:14)
    at IpcIOSession.executeCommand (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:179962:29)
    at IpcIOSession.onMessage (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:180004:51)
    at process.<anonymous> (c:\Users\sohel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:181571:14)
    at process.emit (node:events:526:28)
    at emit (node:internal/child_process:938:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:84:21)

VS Code version: Code 1.77.1 (b7886d7461186a5eac768481578c1d7ca80e2d21, 2023-04-04T23:21:11.906Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 5600G with Radeon Graphics (12 x 3893)| |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)|13.90GB (5.50GB free)| |Process Argv|--crash-reporter-id ae2c2ed6-8f24-4d10-af35-6300eb1c3e35| |Screen Reader|no| |VM|0%|
Extensions (21) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 vscode-expo|byC|0.9.2 npm-intellisense|chr|1.4.4 path-intellisense|chr|2.8.4 codeium|Cod|1.1.72 vscode-eslint|dba|2.4.0 gitlens|eam|13.5.0 prettier-vscode|esb|9.10.4 auto-rename-tag|for|0.1.10 remotehub|Git|0.54.0 vscode-pull-request-github|Git|0.62.0 vscode-env|Iro|0.1.0 template-string-converter|meg|0.6.0 remote-repositories|ms-|0.32.0 vscode-react-native|msj|1.10.2 color-highlight|nau|2.5.0 vscode-react-refactor|pla|1.1.3 code-spell-checker|str|2.20.4 errorlens|use|3.9.0 vscode-icons|vsc|12.2.0 vscode-import-cost|wix|3.3.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vscaat:30438848 vsclangdc:30486549 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 vsccc:30610678 nodejswelcome1:30587005 2e4cg342:30602488 pyind779:30671433 89544117:30613380 pythonsymbol12:30671437 a9j8j154:30646983 showlangstatbar:30672706 vsccsb:30705552 pythonb192:30669360 functionswalk:30687959 pythonms35:30701012 pythonclientmv:30708685 ```
gjsjohnmurray commented 1 year ago

/duplicate of https://github.com/microsoft/vscode/issues/179399

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