microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.93k stars 28.77k 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. #174646

Closed slackwareer closed 1 year ago

slackwareer commented 1 year ago

Type: Bug

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

TypeScript Version: 5.0.0-dev.20230216

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/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:33923:11)
    at parseSimpleUnaryExpression (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:33552:16)
    at parseUnaryExpressionOrHigher (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:33520:35)
    at parseBinaryExpressionOrHigher (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:33438:25)
    at parseAssignmentExpressionOrHigher (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:33111:18)
    at parseExpression (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:33077:16)
    at doOutsideOfContext (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:30773:12)
    at allowInAnd (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:30794:12)
    at parseExpressionOrLabeledStatement (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:34593:24)
    at parseStatement (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:34825:12)
    at parseListElement (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:31544:12)
    at parseList (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:31529:19)
    at parseSourceFileWorker (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:30589:24)
    at Object.parseSourceFile (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:30422:20)
    at createSourceFile (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:30283:21)
    at createLanguageServiceSourceFile (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:134990:22)
    at acquireOrUpdateDocument (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:131912:26)
    at Object.acquireDocumentWithKey (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:131837:12)
    at getOrCreateSourceFileByPath (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:135315:31)
    at Object.getOrCreateSourceFile (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:135295:14)
    at /Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:135227:42
    at Object.getSourceFileWithCache [as getSourceFile] (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:116994:24)
    at findSourceFileWorker (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:119326:23)
    at findSourceFile (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:119246:20)
    at /Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:119195:22
    at getSourceFileFromReferenceWorker (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:119164:26)
    at processSourceFile (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:119193:5)
    at processRootFile (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:118989:5)
    at /Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:117774:41
    at forEach (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:2308:22)
    at createProgram (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:117774:5)
    at synchronizeHostData (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:135251:15)
    at Object.getProgram (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:135323:5)
    at ConfiguredProject2.updateGraphWorker (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:171885:41)
    at ConfiguredProject2.updateGraph (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:171822:32)
    at ConfiguredProject2.updateGraph (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:173004:24)
    at _ProjectService.createLoadAndUpdateConfiguredProject (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:174611:13)
    at _ProjectService.assignProjectToOpenedScriptInfo (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:175702:26)
    at /Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:175982:64
    at flatMap (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:2556:17)
    at _ProjectService.applyChangesInOpenFiles (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:175982:24)
    at updateOpen (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:177127:29)
    at /Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:179694:69
    at IpcIOSession.executeWithRequestId (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:179686:14)
    at IpcIOSession.executeCommand (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:179694:29)
    at IpcIOSession.onMessage (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:179736:51)
    at process.<anonymous> (/Users/wenjunye/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302160/node_modules/typescript/lib/tsserver.js:181304: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 (Universal) (441438abd1ac652551dbe4d408dfcec8a499b8bf, 2023-02-08T21:34:59.000Z) OS version: Darwin x64 22.2.0 Modes: Sandboxed: Yes

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)| |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)|10, 6, 5| |Memory (System)|16.00GB (0.03GB free)| |Process Argv|--crash-reporter-id 5c3e7fee-0bae-4a09-a8ab-c3955099c2bc| |Screen Reader|no| |VM|0%|
Extensions (117) Extension|Author (truncated)|Version ---|---|--- rainbow-brackets|2gu|0.0.6 better-comments|aar|3.0.2 html-snippets|abu|0.2.1 node-essentials|afr|1.1.0 Bookmarks|ale|13.3.1 vscode-sqlite|ale|0.14.1 vscode-django|bat|1.10.0 vscode-icontheme-nomo-dark|be5|1.3.6 django-snippets|bib|1.1.1 django|big|1.0.2 vscode-tailwindcss|bra|0.9.7 npm-intellisense|chr|1.4.4 path-intellisense|chr|2.8.4 vscode-tsv|cte|0.2.1 vue3-snippets|cup|0.2.1 vscode-mysql-client2|cwe|6.2.1 vscode-markdownlint|Dav|0.49.0 vscode-eslint|dba|2.4.0 uniapp-snippet|dlh|0.0.2 jquerysnippets|don|0.0.1 python-environment-manager|don|1.0.4 python-extension-pack|don|1.7.0 gitlens|eam|13.2.0 vscode-html-css|ecm|1.13.1 EditorConfig|Edi|0.16.4 prettier-vscode|esb|9.10.4 auto-close-tag|for|0.5.14 auto-rename-tag|for|0.1.10 code-runner|for|0.12.0 vscode-mysql|for|0.4.1 shell-format|fox|7.2.2 html-snippets|gey|0.2.3 copilot|Git|1.73.8685 vscode-pull-request-github|Git|0.58.1 gc-excelviewer|Gra|4.2.56 h5-code|gre|0.0.4 vscode-drawio|hed|1.6.6 svgeditor|hen|2.9.0 vue-snippets|hol|1.0.4 vscode-picture|Jak|1.0.0 svg|joc|1.5.0 elementUI-snippets|jwy|0.0.2 vsc-python-indent|Kev|1.18.0 tag-inserter|l7s|1.4.0 quickstart|lol|0.1.0 bash-ide-vscode|mad|1.33.0 MagicPython|mag|1.1.0 layui-layer-snippets|mao|0.0.9 color-picker|Mar|1.0.0 rainbow-csv|mec|3.5.0 vscode-language-babel|mgm|0.0.36 code-beautifier|mic|2.3.3 dotenv|mik|1.0.1 vue-volar-extention-pack|Mis|1.1.6 vscode-autoprefixer|mrm|3.0.1 vscode-scss|mrm|0.10.0 vscode-docker|ms-|1.23.3 vscode-edge-devtools|ms-|2.1.1 vscode-kubernetes-tools|ms-|1.3.11 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 remote-ssh|ms-|0.96.0 remote-ssh-edit|ms-|0.84.0 remote-explorer|ms-|0.2.0 vscode-typescript-next|ms-|5.0.202302160 color-highlight|nau|2.5.0 autodocstring|njp|0.6.1 vetur|oct|0.36.1 indent-rainbow|ode|8.3.1 element-ui-helper|oib|1.4.1 vscode-jest|Ort|5.2.3 fabric8-analytics|red|0.3.6 vscode-xml|red|0.24.0 vscode-yaml|red|1.11.0 LiveServer|rit|5.7.9 js-snippets|run|0.2.6 vs-code-prettier-eslint|rve|5.0.4 pytorch-snippets|SBS|1.0.2 vue-vscode-extensionpack|sdr|0.2.0 vue-vscode-snippets|sdr|3.1.1 django-intellisense|sha|0.0.2 vscode-scss-formatter|sib|2.4.5 html5-boilerplate|sid|1.1.1 velocity|sod|0.2.0 html-to-css-autocompletion|sol|1.1.2 autoimport|ste|1.5.4 iconfont-preview|stx|0.0.4 wav-preview|suk|2.0.5 sass-indented|syl|1.8.24 ejs-snippets|Tao|0.1.0 css-class-intellisense|tar|4.3.0 bootstrap4-vscode|the|6.1.0 vscode-status-bar-format-toggle|tom|3.1.1 pdf|tom|1.2.2 lodash-snippets|tom|1.0.0 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 vim|vsc|1.24.3 volar|Vue|1.1.2 vscode-typescript-vue-plugin|Vue|1.1.2 HTML5-extension-pack|wal|1.0.0 vue-element-ui-snippets|wan|0.0.2 jinja|who|0.0.8 vscode-import-cost|wix|3.3.0 vscode-jumpy|wma|0.3.1 vue|Wsc|1.0.26 JavaScriptSnippets|xab|1.8.0 element-plus-vue|xua|1.0.9 markdown-all-in-one|yzh|3.5.0 html-css-class-completion|Zig|1.20.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdc:30486549 c4g48928:30535728 dsvsc012:30540252 azure-dev_surveyone:30548225 vscccc:30610679 pyindex848:30662994 nodejswelcome1cf:30587006 282f8724:30602487 pyind779:30662992 f6dab269:30613381 pythonsymbol12cf:30657549 a9j8j154:30646983 vsctsb:30662444 ```
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?

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!

slackwareer commented 1 year ago

Solved this by Removing ts related plugin.