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. #174638

Closed thydadduong closed 1 year ago

thydadduong 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 (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:33924:11)
    at parseSimpleUnaryExpression (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:33553:16)
    at parseUnaryExpressionOrHigher (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:33521:35)
    at parseBinaryExpressionOrHigher (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:33439:25)
    at parseAssignmentExpressionOrHigher (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:33112:18)
    at parseExpression (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:33078:16)
    at doOutsideOfContext (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:30773:12)
    at allowInAnd (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:30794:12)
    at parseExpressionOrLabeledStatement (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:34594:24)
    at parseStatement (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:34826:12)
    at parseListElement (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:31545:12)
    at parseList (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:31530:19)
    at parseSourceFileWorker (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:30589:24)
    at Object.parseSourceFile (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:30422:20)
    at createSourceFile (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:30283:21)
    at createLanguageServiceSourceFile (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:134991:22)
    at acquireOrUpdateDocument (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:131913:26)
    at Object.acquireDocumentWithKey (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:131838:12)
    at getOrCreateSourceFileByPath (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:135316:31)
    at Object.getOrCreateSourceFile (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:135296:14)
    at /Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:135228:42
    at Object.getSourceFileWithCache [as getSourceFile] (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:116995:24)
    at findSourceFileWorker (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:119327:23)
    at findSourceFile (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:119247:20)
    at /Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:119196:22
    at getSourceFileFromReferenceWorker (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:119165:26)
    at processSourceFile (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:119194:5)
    at processRootFile (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:118990:5)
    at /Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:117775:41
    at forEach (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:2308:22)
    at createProgram (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:117775:5)
    at synchronizeHostData (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:135252:15)
    at Object.getProgram (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:135324:5)
    at ConfiguredProject2.updateGraphWorker (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:171892:41)
    at ConfiguredProject2.updateGraph (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:171829:32)
    at ConfiguredProject2.updateGraph (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:173011:24)
    at _ProjectService.createLoadAndUpdateConfiguredProject (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:174618:13)
    at _ProjectService.assignProjectToOpenedScriptInfo (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:175709:26)
    at /Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:175989:64
    at flatMap (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:2556:17)
    at _ProjectService.applyChangesInOpenFiles (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:175989:24)
    at updateOpen (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:177134:29)
    at /Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:179701:69
    at IpcIOSession.executeWithRequestId (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:179693:14)
    at IpcIOSession.executeCommand (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:179701:29)
    at IpcIOSession.onMessage (/Users/thydaduong/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.202302150/node_modules/typescript/lib/tsserver.js:179743:51)
    at process.<anonymous> (/Users/thydaduong/.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:34:59.000Z) OS version: Darwin x64 22.3.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)|43, 17, 10| |Memory (System)|16.00GB (0.09GB free)| |Process Argv|--crash-reporter-id bfcc286a-8546-463f-8ff2-2dcb413b0491| |Screen Reader|yes| |VM|0%|
Extensions (76) Extension|Author (truncated)|Version ---|---|--- vscode-css-formatter|aes|1.0.2 pug|ama|1.0.1 aws-toolkit-vscode|ama|1.63.0 vscode-ant-design-vue-helper|ant|1.0.6 browse-lite|ant|0.3.1 vite|ant|0.2.5 quitcontrol-vscode|art|4.0.0 vscode-intelephense-client|bme|1.9.5 vscode-tailwindcss|bra|0.9.7 labour-suggestion|cfe|0.1.0 npm-intellisense|chr|1.4.4 path-intellisense|chr|2.8.4 split-html-attributes|dan|1.0.10 dart-code|Dar|3.58.0 gitlens|eam|13.2.0 vscode-html-css|ecm|1.13.1 vscode-author-generator|edw|0.2.2 prettier-vscode|esb|9.10.4 vscode-firefox-debug|fir|2.9.8 auto-close-tag|for|0.5.14 auto-rename-tag|for|0.1.10 vscode-google-translate|fun|1.4.13 vscode-yarn|gam|2.1.0 codespaces|Git|1.13.8 live-sass|gle|6.0.2 svgeditor|hen|2.9.0 monkey-patch|ioc|0.1.23 vsc-python-indent|Kev|1.18.0 dotenv|mik|1.0.1 mongodb-vscode|mon|0.10.0 vscode-docker|ms-|1.23.3 vscode-dotnet-runtime|ms-|1.6.0 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 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-wsl|ms-|0.75.3 vscode-remote-extensionpack|ms-|0.23.0 js-debug-nightly|ms-|2023.2.317 remote-explorer|ms-|0.2.0 vscode-typescript-next|ms-|5.0.202302150 vsliveshare|ms-|1.0.5831 azurerm-vscode-tools|msa|0.15.8 indent-rainbow|ode|8.3.1 tsimporter|pmn|2.0.1 vscode-thunder-client|ran|2.4.1 vscode-commons|red|0.0.6 vscode-xml|red|0.24.0 LiveServer|rit|5.7.9 vs-code-prettier-eslint|rve|5.0.4 vue-vscode-snippets|sdr|3.1.1 bash-beautify|sha|0.1.1 autoimport|ste|1.5.4 code-spell-checker|str|2.16.0 sass-indented|syl|1.8.24 vsfire|tob|1.4.1 pdf|tom|1.2.2 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 rainbow-tags|vol|0.4.1 vscode-icons|vsc|12.2.0 volar|Vue|1.1.2 vscode-typescript-vue-plugin|Vue|1.1.2 vuetify-vscode|vue|0.2.0 fig|wit|0.0.7 change-case|wma|1.0.0 eno|Wsc|2.3.53 fontview|yiw|1.0.1 html-css-class-completion|Zig|1.20.0 vitest-explorer|Zix|0.2.39 (4 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 pythondataviewer:30285071 vscod805cf:30301675 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 pyindex848:30662994 nodejswelcome1cf:30587006 2e4cg342:30602488 pyind779cf:30662993 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!