microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.44k stars 29.35k 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. #174650

Closed Apeknockcode closed 1 year ago

Apeknockcode commented 1 year ago

Type: Bug

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

TypeScript Version: 5.0.0-dev.20230215

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 (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:33924:11)
    at parseSimpleUnaryExpression (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:33553:16)
    at parseUnaryExpressionOrHigher (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:33521:35)
    at parseBinaryExpressionOrHigher (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:33439:25)
    at parseAssignmentExpressionOrHigher (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:33112:18)
    at parseExpression (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:33078:16)
    at doOutsideOfContext (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:30773:12)
    at allowInAnd (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:30794:12)
    at parseExpressionOrLabeledStatement (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:34594:24)
    at parseStatement (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:34826:12)
    at parseListElement (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:31545:12)
    at parseList (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:31530:19)
    at parseSourceFileWorker (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:30589:24)
    at Object.parseSourceFile (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:30422:20)
    at createSourceFile (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:30283:21)
    at createLanguageServiceSourceFile (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:134991:22)
    at acquireOrUpdateDocument (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:131913:26)
    at Object.acquireDocumentWithKey (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:131838:12)
    at getOrCreateSourceFileByPath (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:135316:31)
    at Object.getOrCreateSourceFile (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:135296:14)
    at c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:135228:42
    at Object.getSourceFileWithCache [as getSourceFile] (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:116995:24)
    at findSourceFileWorker (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:119327:23)
    at findSourceFile (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:119247:20)
    at c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:119196:22
    at getSourceFileFromReferenceWorker (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:119165:26)
    at processSourceFile (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:119194:5)
    at processRootFile (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:118990:5)
    at c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:117775:41
    at forEach (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:2308:22)
    at createProgram (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:117775:5)
    at synchronizeHostData (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:135252:15)
    at Object.getProgram (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:135324:5)
    at ConfiguredProject2.updateGraphWorker (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:171892:41)
    at ConfiguredProject2.updateGraph (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:171829:32)
    at ConfiguredProject2.updateGraph (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:173011:24)
    at _ProjectService.createLoadAndUpdateConfiguredProject (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:174618:13)
    at _ProjectService.assignProjectToOpenedScriptInfo (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:175709:26)
    at c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:175989:64
    at flatMap (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:2556:17)
    at _ProjectService.applyChangesInOpenFiles (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:175989:24)
    at updateOpen (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:177134:29)
    at c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:179701:69
    at IpcIOSession.executeWithRequestId (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:179693:14)
    at IpcIOSession.executeCommand (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:179701:29)
    at IpcIOSession.onMessage (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:179743:51)
    at process.<anonymous> (c:\Users\kd_009\.vscode\extensions\ms-vscode.vscode-typescript-next-5.0.202302150\node_modules\typescript\lib\tsserver.js:181311: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:32:34.589Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 5600H with Radeon Graphics (12 x 3294)| |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)|15.36GB (4.05GB free)| |Process Argv|-n --crash-reporter-id dd50e824-9ccb-451f-b967-47776619baba| |Screen Reader|no| |VM|0%|
Extensions (264) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 nestjs-files|Abh|0.5.1 vscode-file-peek|abi|1.0.1 three-js-snippets|aer|0.6.2 vscode-javascript-snippet-pack|aka|0.1.6 Bookmarks|ale|13.3.1 project-manager|ale|12.7.0 nuxt-vscode-extension|all|0.0.21 jest-snippets|and|1.9.1 vscode-json|and|1.5.2 browse-lite|ant|0.3.1 vite|ant|0.2.5 nestjs|ash|1.4.2 vscode-tailwindcss|bra|0.9.7 react-tsx-snippet|bre|0.0.1 better-toml|bun|0.3.2 simple-react-snippets|bur|1.2.7 cargo-inspect|car|0.1.0 quokka|Cen|1.4.0 turbo-console-log|Cha|2.6.3 node-snippets|chr|1.3.3 npm-intellisense|chr|1.4.4 path-intellisense|chr|2.8.4 regex|chr|0.4.0 gitignore|cod|0.9.0 miniprogram-vscode-extension|cra|1.4.15 vscode-svgviewer|css|2.0.0 pnpm-variables|dan|0.0.1 c-cpp-compile-run|dan|1.0.42 dart-code|Dar|3.58.0 vue-template|das|0.0.1 vscode-markdownlint|Dav|0.49.0 vscode-eslint|dba|2.4.0 vscode-faker|dee|2.0.0 npm-browser|den|1.1.4 vscode-npm-source|dku|1.0.0 uniapp-snippet|dlh|0.0.2 npm-links|Dol|0.0.3 auto-open-markdown-preview-single|Don|1.0.0 git-extension-pack|don|0.1.3 githistory|don|0.6.19 javadebugger|don|0.1.5 vscode-electron-build-tools|dsa|0.12.1 vscode-rust-syntax|dun|0.0.32 rust-syntax|dus|0.6.1 gitlens|eam|13.2.0 EditorConfig|Edi|0.16.4 vscode-element-helper|Ele|0.5.6 vscode-great-icons|emm|2.1.90 threejs|En1|0.0.1 prettier-vscode|esb|9.10.4 syntax-highlighter|evg|0.5.0 vs-code-xml-format|fab|0.1.5 mithril-emmet|Fal|0.7.7 vue-format|feb|0.1.8 git-project-manager|fel|1.8.2 vsc|fig|1.2.6 vscode-firefox-debug|fir|2.9.8 vscode-jest-runner|fir|0.4.60 vant-snippets|fis|0.1.5 auto-close-tag|for|0.5.14 auto-rename-tag|for|0.1.10 code-runner|for|0.12.0 shell-format|fox|7.2.2 vscode-rust-config|fra|0.2.0 webpack-4-snippets|fwg|0.0.3 vscode-javac|geo|0.2.45 vscode-pull-request-github|Git|0.58.1 webpack-snippets|gog|0.0.4 go|gol|0.37.1 google-translate|han|1.2.7 vscode-ant-design-pro|han|0.3.0 vscode-snippet-threejs|hao|0.0.3 vscode-test-explorer|hbe|2.21.1 npm-dependency-links|her|1.2.0 vue-snippets|hol|1.0.4 minify|Hoo|0.4.3 vscode-git-tags|how|1.4.4 vscode-npm-dependency|how|1.2.2 vscode-htmlhint|HTM|1.0.4 githd|hui|2.3.3 output-colorizer|IBM|0.1.2 iceworks|ice|1.5.3 iceworks-app|ice|1.0.10 iceworks-codemod|ice|1.0.3 iceworks-doctor|ice|1.2.2 iceworks-generator|ice|1.0.2 iceworks-material-helper|ice|1.1.4 iceworks-project-creator|ice|1.0.8 iceworks-refactor|ice|1.0.4 iceworks-style-helper|ice|1.1.2 iceworks-time-master|ice|1.0.4 npm|ide|1.3.0 vscode-react-typescript|inf|1.3.1 vscode-env|Iro|0.1.0 vscode-pnpm|Jac|0.0.3 chatgpt-vscode-plugin|Jay|1.1.10 vscode-lebab|jer|1.1.0 webpack|jer|3.0.0 vscode-npm-scripts|jia|0.2.4 vscode-peacock|joh|4.2.2 rust-doc-viewer|JSc|3.0.4 ts-debug|kak|0.0.6 vscode-colorize|kam|0.11.1 npm-helper|kar|1.1.4 vscode-jest-test-adapter|kav|0.8.1 vsc-python-indent|Kev|1.18.0 vscode-vitest-runner|kin|0.0.4 vscode-css-to-stylus|kon|0.0.4 vscode-leetcode|Lee|0.18.1 i18n-ally|lok|2.8.1 rust-flash-snippets|lor|2.1.1 vscode-lottie|lot|1.0.5 eslint-rules-zh-plugin|mag|0.2.1 json-to-ts|Mar|1.7.5 ts-error-translator|mat|0.8.0 markdown-shortcuts|mdi|0.12.0 vscode-language-babel|mgm|0.0.36 git-graph|mhu|1.30.0 code-beautifier|mic|2.3.3 sort-typescript-imports|mic|1.4.1 formate|Mik|1.2.1 dotenv|mik|1.0.1 vscode-fileheader|mik|0.0.2 vscode-language-rust|miq|0.14.0 vuex-suggest|mis|1.1.1 vue-volar-extention-pack|Mis|1.1.6 vscode-filesize|mkx|3.1.0 rust-assist|moo|0.2.3 easy-less|mrc|1.7.4 vscode-less|mrm|0.6.3 vscode-scss|mrm|0.10.0 chinese-english-translator|mry|0.5.0 vscode-docker|ms-|1.23.3 vscode-language-pack-zh-hans|MS-|1.75.2023021509 vscode-edge-devtools|ms-|2.1.1 isort|ms-|2022.8.0 python|ms-|2023.2.0 vscode-pylance|ms-|2023.2.30 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 cmake-tools|ms-|1.13.45 cpptools|ms-|1.14.3 cpptools-extension-pack|ms-|1.3.0 js-debug-nightly|ms-|2023.2.317 makefile-tools|ms-|0.6.0 powershell|ms-|2023.1.0 sublime-keybindings|ms-|4.0.10 test-adapter-converter|ms-|0.1.6 vscode-typescript-next|ms-|5.0.202302150 vscode-typescript-tslint-plugin|ms-|1.3.4 node-modules-resolve|nau|1.0.2 vscode-json-editor|nic|0.3.0 vant-helper|Nor|0.0.2 vscode-extension-auto-import|Nuc|1.4.3 nutui-vscode-extension|nut|1.0.2 rust-and-friends|nyx|1.0.0 autoCommit|OBK|1.0.9 vetur|oct|0.36.1 element-ui-helper|oib|1.4.1 es6-css-minify|olb|3.3.3 vscode-jest|Ort|5.2.3 vuehelper|oys|0.1.0 cargo|pan|0.2.3 gitpatch|par|0.2.1 colorful-comments|Par|1.0.0 vue-beautify|pea|2.0.4 vscode-versionlens|pfl|1.5.0 tsimporter|pmn|2.0.1 rust-targets|Pol|1.1.1 vscode-css-peek|pra|4.2.0 tslint-vue|pro|1.5.6 vue3-composition-snippets|psa|0.0.4 minapp-vscode|qiu|2.4.8 env-safe|rap|1.0.1 java|red|1.14.0 vscode-yaml|red|1.11.0 live-sass|rit|3.0.0 LiveServer|rit|5.7.9 any-rule|rus|0.3.18 rust-analyzer|rus|0.3.1402 vs-code-prettier-eslint|rve|5.0.4 px-to-rem|sai|1.3.1 vue-vscode-extensionpack|sdr|0.2.0 vue-vscode-snippets|sdr|3.1.1 crates|ser|0.5.10 git-merger|sha|0.4.1 code-settings-sync|Sha|3.4.3 markdown-preview-enhanced|shd|0.6.7 vue-helper|she|2.4.7 vscode-scss-formatter|sib|2.4.5 html5-boilerplate|sid|1.1.1 css-auto-prefix|spo|0.1.7 guides|spy|0.9.3 element-ui-snippets|SS|0.7.2 autoimport|ste|1.5.4 addDocComments|ste|0.0.8 code-spell-checker|str|2.16.0 vscode-stylelint|sty|1.2.4 rust-pack|Swe|0.3.3 vscode-rust-test-adapter|Swe|0.11.0 sass-indented|syl|1.8.24 tabnine-vscode|Tab|3.6.38 even-better-toml|tam|0.19.0 tauri-vscode|tau|0.2.1 vscode-html-to-css|tau|1.2.0 ayu|tea|1.0.5 vs-code-node-require|tgr|1.10.2 vue-i18n|thi|1.3.1 python|tht|0.2.3 vue-docs|tit|1.0.2 vscode-status-bar-format-toggle|tom|3.1.1 vscode-npm-scripts|tra|0.2.1 cmake|twx|0.0.17 codelf|unb|11.7.0 vscode-lldb|vad|1.8.1 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 vscode-spring-boot|vmw|1.44.0 vscode-java-debug|vsc|0.48.0 vscode-java-dependency|vsc|0.21.1 vscode-java-pack|vsc|0.25.7 vscode-java-test|vsc|0.37.1 vscode-maven|vsc|0.40.4 vscode-spring-initializr|vsc|0.11.2 vscode-icons|vsc|12.2.0 haxe-debug|vsh|1.2.3 volar|Vue|1.1.2 vscode-typescript-vue-plugin|Vue|1.1.2 gitblame|wad|10.1.0 Java-extension-pack|wal|1.0.0 quokka-vscode|Wal|1.0.525 sneak-mark|wan|0.0.6 vscode-todo-highlight|way|1.0.5 chatgpt-china|Whe|4.9.4 vscode-import-cost|wix|3.3.0 webpack-progress|wk-|0.0.8 change-case|wma|1.0.0 eno|Wsc|2.3.53 vue|Wsc|1.0.26 JavaScriptSnippets|xab|1.8.0 ReactSnippets|xab|2.4.0 chatgpt-vscode-plugin-zh|xia|1.0.2 vue-style-beautify|xig|1.1.0 axios-snippets|Ygg|1.0.0 vuter|yoy|0.1.2 vue-dev-extension-pack|ysh|1.0.0 antd|yua|0.0.41 webpack|yuh|0.0.6 cloudmusic|YXL|9.18.0 markdown-pdf|yza|1.4.4 markdown-all-in-one|yzh|3.5.0 json|Zai|2.0.2 rust-snippets|Zak|0.0.1 rust-extension-pack|Zer|1.1.0 ant-design-code-snippets-for-vue|zha|0.0.6 rust-mod-generator|Zha|1.0.10 vitest-explorer|Zix|0.2.39 vscode-open-in-github|ziy|1.3.6 vue|znc|0.12.0 (10 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdf:30486550 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyone:30548225 vscccc:30610679 pyindex848:30662994 nodejswelcome1cf:30587006 2e4cg342:30602488 pyind779cf:30662993 89544117:30613380 pythonsymbol12:30657548 showlangstatbar:30664136 ```
mjbvz commented 1 year ago

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

Specifically did you try disabling the typescript-vue-plugin-forward plugin?

mjbvz commented 1 year ago

Duplicate of https://github.com/vuejs/language-tools/issues/2434

As the issue reporter noted, this is likely caused by one of the Vue extensions you have installed. Please following up with the correct extension so that they can investigate and fix this