microsoft / vscode

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

TS Server fatal error: Cannot read property 'flags' of undefined #139052

Closed Mr-Hu-96 closed 2 years ago

Mr-Hu-96 commented 2 years ago

Issue Type: Bug

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

TypeScript Version: 4.5.2

Steps to reproduce crash 1. 2. 3.

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

TypeError: Cannot read property 'flags' of undefined
    at getPropertyOfObjectType (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:57005:22)
    at getPropertyOfType (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:57665:24)
    at resolveESModuleSymbol (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49811:54)
    at getTargetOfNamespaceImport (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:48996:28)
    at getTargetOfAliasDeclaration (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49230:28)
    at resolveAlias (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49275:30)
    at getSymbol (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:47833:38)
    at resolveNameHelper (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:48125:34)
    at resolveName (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:48108:20)
    at resolveEntityName (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49447:42)
    at getTargetOfAliasLikeExpression (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49204:29)
    at getTargetOfExportAssignment (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49193:28)
    at getTargetOfAliasDeclaration (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49240:28)
    at resolveAlias (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49275:30)
    at resolveSymbol (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49265:67)
    at resolveExternalModuleSymbol (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49757:36)
    at getTargetOfNamespaceExportDeclaration (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49180:28)
    at getTargetOfAliasDeclaration (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49242:28)
    at resolveAlias (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49275:30)
    at tryResolveAlias (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:49291:24)
    at getCandidateName (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:72927:33)
    at Object.getSpellingSuggestion (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:1873:33)
    at getSpellingSuggestionForName (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:72917:23)
    at d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:72858:24
    at resolveNameHelper (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:48416:30)
    at getSuggestedSymbolForNonexistentSymbol (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:72840:26)
    at resolveNameHelper (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:48438:42)
    at resolveName (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:48108:20)
    at getGlobalSymbol (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:58878:20)
    at getGlobalTypeSymbol (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:58860:20)
    at getGlobalType (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:58881:26)
    at initializeTypeChecker (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:85034:52)
    at Object.createTypeChecker (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:47390:9)
    at Object.getTypeChecker (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:114385:79)
    at synchronizeHostData (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:159863:21)
    at Object.getProgram (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:159984:13)
    at AutoImportProviderProject.Project.updateGraphWorker (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:164998:53)
    at AutoImportProviderProject.Project.updateGraph (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:164927:42)
    at AutoImportProviderProject.updateGraph (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:165772:70)
    at Object.updateProjectIfDirty (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:166409:45)
    at ConfiguredProject.Project.getPackageJsonAutoImportProvider (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:165547:32)
    at ConfiguredProject.Project.updateGraph (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:164965:26)
    at ConfiguredProject.updateGraph (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:165920:63)
    at ProjectService.createLoadAndUpdateConfiguredProject (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:167644:25)
    at ProjectService.assignProjectToOpenedScriptInfo (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:168727:44)
    at d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:169067:97
    at Object.flatMap (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:522:25)
    at ProjectService.applyChangesInOpenFiles (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:169067:41)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:170225:46)
    at d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:172158:88
    at IOSession.Session.executeWithRequestId (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:172149:28)
    at IOSession.Session.executeCommand (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:172158:33)
    at IOSession.Session.onMessage (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:172184:35)
    at Interface.<anonymous> (d:\上课软件\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:174789:31)
    at Interface.emit (events.js:315:20)
    at Interface._onLine (readline.js:337:10)
    at Interface._normalWrite (readline.js:482:12)
    at Socket.ondata (readline.js:194:10)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

VS Code version: Code 1.63.0 (7db1a2b88f7557e0a43fec75b6ba7e50b3e9f77e, 2021-12-07T06:26:56.179Z) OS version: Windows_NT x64 10.0.19042 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz (4 x 2400)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|11.71GB (2.75GB free)| |Process Argv|--crash-reporter-id 2f76fffa-23e7-4e0b-a9ac-e72ead402d7a| |Screen Reader|no| |VM|0%|
Extensions (40) Extension|Author (truncated)|Version ---|---|--- aessoft-class-autocomplete|AES|0.1.0 vscode-intelephense-client|bme|1.8.0 path-intellisense|chr|2.6.0 vscode-weapp-api|cod|0.1.8 vscode-wxml|cod|0.1.9 bracket-pair-colorizer|Coe|1.0.62 vscode-office|cwe|2.4.2 vscode-markdownlint|Dav|0.45.0 gitlens|eam|11.7.0 vscode-html-css|ecm|1.10.2 prettier-vscode|esb|9.0.0 auto-close-tag|for|0.5.13 auto-rename-tag|for|0.1.9 code-runner|for|0.11.6 translator|for|0.0.3 vue-snippets|hol|1.0.4 beautify|Hoo|1.5.0 volar|joh|0.29.8 svn-scm|joh|2.15.2 dotenv|mik|1.0.1 vue-volar-extention-pack|Mis|1.0.1 vscode-docker|ms-|1.18.0 vscode-language-pack-zh-hans|MS-|1.63.2 remote-containers|ms-|0.209.5 vscode-typescript-tslint-plugin|ms-|1.3.3 syncing|non|3.1.0 open-html-in-browser|pea|2.1.8 view-in-browser|qin|0.0.5 minapp-vscode|qiu|2.4.5 LiveServer|rit|5.6.1 vscode-scss-formatter|sib|2.3.3 autoimport|ste|1.5.4 iconfont-preview|stx|0.0.4 sass-indented|syl|1.8.18 vscode-css-blocks|vun|0.0.6 save-and-run|wk-|0.0.22 vue|Wsc|1.0.26 JavaScriptSnippets|xab|1.8.0 easy-wxless|yun|1.4.0 html-css-class-completion|Zig|1.20.0
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythontb:30283811 pythonvspyt551:30345470 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 pythondataviewer:30285071 vscod805:30301674 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 pythonrunftest32:30373476 pythonf5test824:30373475 javagetstartedt:30391933 pythonvspyt187:30373474 vsaa593cf:30376535 pythonvs932:30410667 vscop804cf:30404767 vscop453:30404998 vsrem710cf:30405999 ```
gjsjohnmurray commented 2 years ago

/duplicate of #138794