microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
161.05k stars 28.26k 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. #175286

Closed killsos closed 1 year ago

killsos commented 1 year ago

Type: Bug

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

TypeScript Version: 5.0.0-dev.20230221

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/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:33949:11)
    at parseSimpleUnaryExpression (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:33582:16)
    at parseUnaryExpressionOrHigher (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:33550:35)
    at parseBinaryExpressionOrHigher (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:33468:25)
    at parseAssignmentExpressionOrHigher (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:33141:18)
    at parseExpression (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:33107:16)
    at doOutsideOfContext (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:30804:12)
    at allowInAnd (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:30825:12)
    at parseExpressionOrLabeledStatement (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:34619:24)
    at parseStatement (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:34851:12)
    at parseListElement (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:31575:12)
    at parseList (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:31560:19)
    at parseSourceFileWorker (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:30620:24)
    at Object.parseSourceFile (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:30453:20)
    at createSourceFile (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:30314:21)
    at createLanguageServiceSourceFile (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:135115:22)
    at acquireOrUpdateDocument (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:132037:26)
    at Object.acquireDocumentWithKey (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:131962:12)
    at getOrCreateSourceFileByPath (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:135440:31)
    at Object.getOrCreateSourceFile (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:135420:14)
    at /Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:135352:42
    at Object.getSourceFileWithCache [as getSourceFile] (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:117119:24)
    at findSourceFileWorker (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:119451:23)
    at findSourceFile (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:119371:20)
    at /Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:119320:22
    at getSourceFileFromReferenceWorker (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:119289:26)
    at processSourceFile (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:119318:5)
    at processRootFile (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:119114:5)
    at /Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:117899:41
    at forEach (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:2309:22)
    at createProgram (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:117899:5)
    at synchronizeHostData (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:135376:15)
    at Object.getProgram (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:135448:5)
    at ConfiguredProject2.updateGraphWorker (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:172060:41)
    at ConfiguredProject2.updateGraph (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:171997:32)
    at ConfiguredProject2.updateGraph (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:173179:24)
    at _ProjectService.createLoadAndUpdateConfiguredProject (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:174786:13)
    at _ProjectService.assignProjectToOpenedScriptInfo (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:175877:26)
    at /Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:176157:64
    at flatMap (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:2557:17)
    at _ProjectService.applyChangesInOpenFiles (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:176157:24)
    at updateOpen (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:177302:29)
    at /Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:179869:69
    at IpcIOSession.executeWithRequestId (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:179861:14)
    at IpcIOSession.executeCommand (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:179869:29)
    at IpcIOSession.onMessage (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:179911:51)
    at process.<anonymous> (/Users/qinlei/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302210/node_modules/typescript/lib/tsserver.js:181479: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.75.1 (441438abd1ac652551dbe4d408dfcec8a499b8bf, 2023-02-08T21:34:59.000Z) OS version: Darwin x64 21.6.0 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)| |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)|7, 6, 5| |Memory (System)|64.00GB (1.23GB free)| |Process Argv|--crash-reporter-id 4417dd31-27c4-46d1-8951-90bb2c218402| |Screen Reader|yes| |VM|0%|
Extensions (251) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 vscode-file-peek|abi|1.0.1 codesnap|adp|1.3.4 vscode-css-formatter|aes|1.0.2 TabOut|alb|0.2.2 Bookmarks|ale|13.3.1 project-manager|ale|12.7.0 vscode-sequence-diagrams|Ale|0.4.7 vscode-sqlite|ale|0.14.1 le5le-topology-plugin|Als|0.0.1 vscode-color|ans|0.4.5 gitstash|art|5.1.0 atlascode|atl|3.0.2 code-gnu-global|aus|0.2.2 markdown-extension-pack|bat|0.7.0 color-info|bie|0.7.2 docs-view|bie|0.0.11 emojisense|bie|0.9.1 markdown-checkbox|bie|0.4.0 markdown-emoji|bie|0.3.0 markdown-preview-github-styles|bie|1.0.1 bracket-pair-color-dlw|Bra|0.0.6 htmltagwrap|bra|0.0.7 vscode-tailwindcss|bra|0.9.7 better-toml|bun|0.3.2 indented-block-highlighting|byi|1.0.7 multi-cursor-case-preserve|Car|1.0.5 turbo-console-log|Cha|2.7.1 vscode-standardjs|che|1.4.1 vscode-better-align|cho|1.4.1 npm-intellisense|chr|1.4.4 path-intellisense|chr|2.8.4 regex|chr|0.4.0 cssrem|cip|3.0.2 gitignore|cod|0.9.0 doxdocgen|csc|1.4.0 excel-to-markdown-table|csh|1.3.0 vscode-svgviewer|css|2.0.0 postcss|css|1.0.9 markdown-table-prettify|dar|3.6.0 dart-code|Dar|3.59.20230214 flutter|Dar|3.58.0 vscode-markdownlint|Dav|0.49.0 jshint|dba|0.11.0 vscode-eslint|dba|2.4.0 vscode-dash|dee|2.4.0 vscode-faker|dee|2.0.0 vscode-deno|den|3.17.0 parameter-hints|Dom|0.2.7 git-extension-pack|don|0.1.3 githistory|don|0.6.19 xml|Dot|2.5.1 es7-react-js-snippets|dsz|4.4.3 parquet-viewer|dvi|2.2.2 bracket-pair-toggler|dzh|0.0.3 css-initial-value|dzh|0.2.6 gitlens|eam|13.3.0 earthfile-syntax-highlighting|ear|0.0.12 vscode-html-css|ecm|1.13.1 EditorConfig|Edi|0.16.4 vscode-npm-script|eg2|0.3.29 vscode-great-icons|emm|2.1.90 vsc-material-theme|Equ|33.6.0 vsc-material-theme-icons|equ|2.5.0 prettier-vscode|esb|9.10.4 mithril-emmet|Fal|0.7.7 git-project-manager|fel|1.8.2 file-icons|fil|1.0.29 vscode-jest-runner|fir|0.4.60 auto-close-tag|for|0.5.14 auto-complete-tag|for|0.1.0 auto-rename-tag|for|0.1.10 code-runner|for|0.12.0 terminal|for|0.0.10 vscode-pull-request-github|Git|0.58.2 sass-lint|gle|1.0.7 mdmath|goe|2.7.4 gc-excelviewer|Gra|4.2.56 todo-tree|Gru|0.0.224 vscode-test-explorer|hbe|2.21.1 vscode-drawio|hed|1.6.6 randomeverything|hel|0.0.3 vscode-ungit|Hir|2.2.3 vue-snippets|hol|1.0.4 beautify|Hoo|1.5.0 codesnap-plus|hui|1.4.1 githd|hui|2.3.3 rest-client|hum|0.25.1 iceworks-style-helper|ice|1.1.2 icon-fonts|idl|2.5.4 error-gutters|Igo|1.0.1 path-autocomplete|ion|1.23.1 path-alias|IWA|0.12.3 RelativePath|jak|1.5.0 vscode-edit-csv|jan|0.7.3 search-node-modules|jas|1.3.0 vscode-pigments|jas|2.0.0 vue|jcb|0.1.5 plantuml|jeb|2.17.5 polacode-2019|jef|0.6.1 snipped|jef|1.3.0 pubspec-assist|jer|2.3.2 vscode-live-frame|jev|0.1.1 vscode-graphviz|joa|0.0.6 vscode-peacock|joh|4.2.2 cmake-language-support-vscode|jos|0.0.9 vscode-styled-components|jpo|1.7.0 vscode-random|jre|1.11.0 ts-debug|kak|0.0.6 vscode-colorize|kam|0.11.1 vscode-codemetrics|kis|1.26.1 vscode-gutter-preview|kis|0.30.0 vscode-github|Kni|0.30.7 wrapSelection|kon|0.10.0 krinql-vscode|Kri|0.1.1 refactorix|kri|0.3.6 kool-test-script|kuj|1.0.53 vscode-leetcode|Lee|0.18.1 blockman|leo|1.7.1 git-tree-compare|let|1.14.0 inline-parameters|lia|0.2.1 vue-alias-skip|lih|0.0.25 vscode-python-test-adapter|lit|0.7.1 i18n-ally|lok|2.8.1 MagicPython|mag|1.1.0 json-to-ts|Mar|1.7.5 ts-error-translator|mat|0.8.0 web-accessibility|Max|0.2.83 start-git-bash|McC|1.2.1 markdown-shortcuts|mdi|0.12.0 rainbow-csv|mec|3.5.0 font-awesome-codes-html|med|0.0.7 template-string-converter|meg|0.6.0 git-graph|mhu|1.30.0 dotenv|mik|1.0.1 document|min|2.2.1 vue-volar-extention-pack|Mis|1.1.6 vscode-clang|mit|0.2.4 vscode-filesize|mkx|3.1.0 prettify-json|moh|0.0.3 vscode-autoprefixer|mrm|3.0.1 vscode-docker|ms-|1.23.3 vscode-language-pack-zh-hans|MS-|1.75.2023021509 csharp|ms-|1.25.4 vscode-dotnet-runtime|ms-|1.6.0 vscode-edge-devtools|ms-|2.1.1 isort|ms-|2022.8.0 python|ms-|2023.2.0 vscode-pylance|ms-|2023.2.40 jupyter|ms-|2023.1.2010391206 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.14 vscode-jupyter-cell-tags|ms-|0.1.6 vscode-jupyter-slideshow|ms-|0.1.5 remote-containers|ms-|0.275.1 remote-wsl|ms-|0.75.3 azure-account|ms-|0.11.3 cmake-tools|ms-|1.13.45 cpptools|ms-|1.14.3 cpptools-extension-pack|ms-|1.3.0 test-adapter-converter|ms-|0.1.6 vscode-typescript-next|ms-|5.0.202302210 vscode-typescript-tslint-plugin|ms-|1.3.4 vsliveshare|ms-|1.0.5832 sqltools|mtx|0.27.1 reload|nat|0.0.6 color-highlight|nau|2.5.0 node-modules-resolve|nau|1.0.2 vscode-for-node-js-development-pack|nod|2.0.1 indent-rainbow|ode|8.3.1 color-tabs-vscode-ext|ore|0.12.1 vscode-ios-common-files|Ort|1.0.5 vscode-jest|Ort|5.2.3 open-html-in-browser|pea|2.1.10 vscode-versionlens|pfl|1.5.0 material-icon-theme|PKi|4.24.0 vscode-react-refactor|pla|1.1.3 tsimporter|pmn|2.0.1 vscode-css-peek|pra|4.2.0 quicktype|qui|12.0.46 vscode-thunder-client|ran|2.4.3 typescript-hero|rbb|3.0.0 vscode-commons|red|0.0.6 vscode-yaml|red|1.11.0 git-commit-plugin|red|1.1.2 LiveServer|rit|5.7.9 bash-debug|rog|0.3.9 postcode|roh|1.3.9 rust|rus|0.7.9 rust-analyzer|rus|0.4.1413 partial-diff|ryu|1.4.3 twind-intellisense|sas|0.2.1 vscode-javascript-booster|sbu|14.0.1 vue-vscode-snippets|sdr|3.1.1 code-settings-sync|Sha|3.4.3 trailing-spaces|sha|0.4.1 markdown-preview-enhanced|shd|0.6.7 vscode-scss-formatter|sib|2.4.5 svg-preview|Sim|2.8.3 indenticator|Sir|0.7.0 css-auto-prefix|spo|0.1.7 autoimport|ste|1.5.4 unique-window-colors|stu|1.0.51 svelte-vscode|sve|107.1.0 sass-indented|syl|1.8.24 tabnine-vscode|Tab|3.6.38 chinese-color|tai|1.1.5 tauri-vscode|tau|0.2.1 vscode-markdown-paste-image|tel|0.19.4 vs-code-node-require|tgr|1.10.2 python|tht|0.2.3 shellcheck|tim|0.29.4 vscode-status-bar-format-toggle|tom|3.1.1 autocomplate-shell|tru|0.1.1 cmake|twx|0.0.17 sort-lines|Tyr|1.9.1 errorlens|use|3.7.0 es-quotes|vil|0.2.6 highlight-matching-tag|vin|0.10.1 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 vscode-maven|vsc|0.40.4 vscode-icons|vsc|12.2.0 gistfs|vsl|0.4.1 volar|Vue|1.1.7 vscode-typescript-vue-plugin|Vue|1.1.5 gitblame|wad|10.1.0 nodejs-extension-pack|wad|0.1.9 crs-al-language-extension|wal|1.5.25 footsteps|Wat|0.1.0 vscode-todo-highlight|way|1.0.5 fig|wit|0.0.7 vscode-import-cost|wix|3.3.0 change-case|wma|1.0.0 vscode-jumpy|wma|0.3.1 vue|Wsc|1.0.26 JavaScriptSnippets|xab|1.8.0 ReactSnippets|xab|2.4.0 local-history|xyz|1.8.1 vscode-surround|yat|1.5.0 yog-plantuml-highlight|Yog|0.0.5 emmet-live|yse|1.0.0 markdown-pdf|yza|1.4.4 markdown-all-in-one|yzh|3.5.0 previewjs|zen|1.17.4 rm-js-comment|zha|1.0.0 LiveServerPP|zho|5.7.1 material-theme|zhu|3.15.6 vue-component|zhu|1.1.0 html-css-class-completion|Zig|1.20.0 vscode-open-in-github|ziy|1.3.6 (6 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewvextcfv2:30669238 azure-dev_surveyone:30548225 pyindex848:30662994 nodejswelcome1:30587005 3biah626:30602489 pyind779:30671433 f6dab269:30613381 pythonsymbol12:30671437 ```
VSCodeTriageBot 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!