microsoft / vscode

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

TS Server fatal error: Debug Failure. False expression: Type assertions should never be parsed outside of TS; they should either be comparisons or JSX. #174230

Closed chakAs3 closed 1 year ago

chakAs3 commented 1 year ago

Type: Bug

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

TypeScript Version: 5.0.0-dev.20230210

Steps to reproduce crash

1. 2. 3.

Global TypeScript Server Plugins

❗️ Please test with extensions disabled. Extensions are the root cause of most TypeScript server crashes

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. False expression: Type assertions should never be parsed outside of TS; they should either be comparisons or JSX.
    at parseTypeAssertion (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:33923:11)
    at parseSimpleUnaryExpression (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:33552:16)
    at parseUnaryExpressionOrHigher (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:33520:35)
    at parseBinaryExpressionOrHigher (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:33438:25)
    at parseAssignmentExpressionOrHigher (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:33111:18)
    at parseExpression (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:33077:16)
    at doOutsideOfContext (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:30772:12)
    at allowInAnd (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:30793:12)
    at parseExpressionOrLabeledStatement (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:34593:24)
    at parseStatement (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:34825:12)
    at parseListElement (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:31544:12)
    at parseList (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:31529:19)
    at parseSourceFileWorker (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:30588:24)
    at Object.parseSourceFile (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:30421:20)
    at createSourceFile (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:30282:21)
    at createLanguageServiceSourceFile (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:134900:22)
    at acquireOrUpdateDocument (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:131822:26)
    at Object.acquireDocumentWithKey (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:131747:12)
    at getOrCreateSourceFileByPath (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:135225:31)
    at Object.getOrCreateSourceFile (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:135205:14)
    at /Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:135137:42
    at Object.getSourceFileWithCache [as getSourceFile] (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:116904:24)
    at findSourceFileWorker (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:119236:23)
    at findSourceFile (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:119156:20)
    at /Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:119105:22
    at getSourceFileFromReferenceWorker (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:119074:26)
    at processSourceFile (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:119103:5)
    at processRootFile (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:118899:5)
    at /Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:117684:41
    at forEach (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:2308:22)
    at createProgram (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:117684:5)
    at synchronizeHostData (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:135161:15)
    at Proxy.getProgram (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:135233:5)
    at ConfiguredProject2.updateGraphWorker (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:171784:41)
    at ConfiguredProject2.updateGraph (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:171721:32)
    at ConfiguredProject2.updateGraph (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:172903:24)
    at _ProjectService.createLoadAndUpdateConfiguredProject (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:174510:13)
    at _ProjectService.assignProjectToOpenedScriptInfo (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:175601:26)
    at /Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:175881:64
    at flatMap (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:2556:17)
    at _ProjectService.applyChangesInOpenFiles (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:175881:24)
    at updateOpen (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:177026:29)
    at /Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:179593:69
    at IpcIOSession.executeWithRequestId (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:179585:14)
    at IpcIOSession.executeCommand (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:179593:29)
    at IpcIOSession.onMessage (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:179635:51)
    at process.<anonymous> (/Users/abdulrehman/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-5.0.202302100/node_modules/typescript/lib/tsserver.js:181203: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 - Insiders 1.74.0-insider (Universal) (5235c6bb189b60b01b1f49062f4ffa42384f8c91, 2022-12-05T10:19:00.076Z) OS version: Darwin arm64 21.4.0 Modes: Sandboxed: Yes

System Info |Item|Value| |---|---| |CPUs|Apple M1 Pro (10 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
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|6, 6, 7| |Memory (System)|16.00GB (0.31GB free)| |Process Argv|--crash-reporter-id f7329165-21c2-49f6-8853-05f7593f05c4| |Screen Reader|no| |VM|0%|
Extensions (15) Extension|Author (truncated)|Version ---|---|--- better-toml|bun|0.3.2 vscode-eslint|dba|2.4.0 gitlens|eam|2023.2.1204 copilot|Git|1.72.8614 vscode-pull-request-github|Git|0.57.2022122310 vscode-docker|ms-|1.23.3 remote-containers|ms-|0.269.0 powershell|ms-|2023.1.0 vscode-typescript-next|ms-|5.0.202302100 angular-console|nrw|17.29.0 svelte-vscode|sve|107.0.2 vscode-mdx|uni|1.2.1 volar|Vue|1.0.24 vscode-typescript-vue-plugin|Vue|1.0.25 markdown-all-in-one|yzh|3.5.0 (4 theme extensions excluded)
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30422396 pythontb:30258533 pythonptprofiler:30281269 vshan820:30294714 pythondataviewer:30285072 vscod805:30301674 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30404738 cppdebug:30492333 vscaac:30438845 vsclangdf:30492506 c4g48928:30535728 dsvsc012:30540252 pynewext54:30618038 pylantcb52:30590116 pyindex848:30611229 nodejswelcome1:30587009 pyind779:30611226 pythonsymbol12:30651887 6233i204:30659907 pythonb192:30661256 ```
vscodenpa commented 1 year ago

This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines. If you don't know which extension is causing the problem, you can run Help: Start extension bisect from the command palette (F1) to help identify the problem extension.

Happy Coding!