microsoft / vscode

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

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

Closed Baoyx007 closed 2 years ago

Baoyx007 commented 2 years ago

Issue Type: Bug

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

TypeScript Version: 4.5.4

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 (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:57011:22)
    at getPropertyOfType (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:57671:24)
    at resolveESModuleSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:49817:54)
    at getTargetOfNamespaceImport (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:49002:28)
    at getTargetOfAliasDeclaration (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:49236:28)
    at resolveAlias (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:49281:30)
    at getSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:47838:38)
    at resolveNameHelper (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:48131:34)
    at resolveName (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:48114:20)
    at resolveEntityName (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:49453:42)
    at getTargetOfExportSpecifier (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:49193:17)
    at getTargetOfAliasDeclaration (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:49243:28)
    at resolveAlias (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:49281:30)
    at resolveSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:49271:67)
    at mergeSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:47624:42)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:47739:47
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:47737:20)
    at mergeSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:47648:21)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:47739:47
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:47737:20)
    at initializeTypeChecker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:85010:21)
    at Object.createTypeChecker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:47395:9)
    at Object.getTypeChecker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:114404:79)
    at synchronizeHostData (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:159898:21)
    at Object.getProgram (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:160019:13)
    at ConfiguredProject.Project.updateGraphWorker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165033:53)
    at ConfiguredProject.Project.updateGraph (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:164962:42)
    at ConfiguredProject.updateGraph (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165955:63)
    at ProjectService.createLoadAndUpdateConfiguredProject (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:167679:25)
    at ProjectService.assignProjectToOpenedScriptInfo (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:168762:44)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:169102:97
    at Object.flatMap (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:522:25)
    at ProjectService.applyChangesInOpenFiles (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:169102:41)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:170260:46)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:172193:88
    at IOSession.Session.executeWithRequestId (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:172184:28)
    at IOSession.Session.executeCommand (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:172193:33)
    at IOSession.Session.onMessage (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:172219:35)
    at Interface.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:174824: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 - Insiders 1.64.0-insider (807bf598bea406dcb272a9fced54697986e87768, 2021-12-20T05:14:16.036Z) OS version: Darwin x64 21.2.0 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2200)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|8, 4, 9| |Memory (System)|16.00GB (0.15GB free)| |Process Argv|--crash-reporter-id 77bc3f3c-d39f-4ec0-abc8-5afbf1eb4a5a| |Screen Reader|no| |VM|0%|
Extensions (92) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|2.1.0 vscode-nginx-conf|ahm|0.1.3 Handlebars|and|0.4.1 slidev|ant|0.3.3 nestjs|ash|1.4.2 color-info|bie|0.7.0 better-toml|bun|0.3.2 gitignore|cod|0.7.0 vscode-svgviewer|css|2.0.0 vscode-eslint|dba|2.2.2 javascript-ejs-support|Dig|1.3.1 githistory|don|0.6.19 es7-react-js-snippets|dsz|3.1.1 gitlens|eam|11.7.0 EditorConfig|Edi|0.16.4 prettier-vscode|esb|9.0.0 nunjucks-template|ese|0.4.2 vscode-antd-rush|fi3|2.1.1 auto-close-tag|for|0.5.13 auto-complete-tag|for|0.1.0 auto-rename-tag|for|0.1.9 shell-format|fox|7.2.2 flatbuffers|gab|0.1.0 vscode-lombok|Gab|1.0.1 copilot|Git|1.7.4421 todo-tree|Gru|0.0.214 vscode-nginx-conf-hint|han|0.3.0 vscode-drawio|hed|1.6.3 rest-client|hum|0.24.6 reason-vscode|jar|1.7.13 search-node-modules|jas|1.3.0 docthis|joe|0.7.1 vscode-styled-components|jpo|1.7.0 vscode-colorize|kam|0.11.1 vscode-github|Kni|0.30.7 graphql-for-vscode|kum|1.15.3 vscode-leetcode|Lee|0.18.0 pop-n-lock-theme-vscode|Lux|3.32.7 dotenv|mik|1.0.1 vscode-docker|ms-|1.18.0 python|ms-|2021.12.1559732655 vscode-pylance|ms-|2021.12.2 jupyter|ms-|2022.1.1001601240 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.4 remote-containers|ms-|0.209.6 remote-ssh|ms-|0.70.0 remote-ssh-edit|ms-|0.70.0 vscode-remote-extensionpack|ms-|0.21.0 vsliveshare|ms-|1.0.5200 sqltools|mtx|0.23.0 vscode-jest|Ort|4.2.1 vscode-boot-dev-pack|Piv|0.1.0 vscode-concourse|Piv|1.29.0 vscode-manifest-yaml|Piv|1.29.0 vscode-spring-boot|Piv|1.29.0 material-icon-theme|PKi|4.11.0 quicktype|qui|12.0.46 diff|raf|0.0.1 nginx-formatter|ray|0.0.13 vscode-p3c|Rec|0.1.2 java|red|1.2.0 vscode-commons|red|0.0.6 vscode-community-server-connector|red|0.25.2 vscode-rsp-ui|red|0.23.11 vscode-xml|red|0.18.2 vscode-yaml|red|1.2.2 nunjucks|ron|0.3.0 vscode-nginx|sha|0.6.0 vscode-checkstyle|she|1.4.1 mdx|sil|0.1.0 pegjs-language|Sir|1.0.4 swdc-vscode|sof|2.6.19 vscode-stylelint|sty|1.2.1 tabnine-vscode|Tab|3.5.11 even-better-toml|tam|0.14.2 open-in-browser|tec|2.0.0 vscode-markdown-paste-image|tel|0.14.0 vscode-status-bar-format-toggle|tom|3.0.0 vscodeintellicode|Vis|1.2.15 vscode-java-debug|vsc|0.37.0 vscode-java-dependency|vsc|0.18.9 vscode-java-pack|vsc|0.20.0 vscode-maven|vsc|0.34.1 vscode-spring-boot-dashboard|vsc|0.2.0 vscode-spring-initializr|vsc|0.8.0 vim|vsc|1.21.10 vscode-nginx|wil|0.7.2 pestfile|xor|0.2.0 markdown-all-in-one|yzh|3.4.0 vscode-asciiflow2|zen|0.2.0 linkerscript|Zix|1.0.2 (4 theme extensions excluded)
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythontb:30258533 pythonptprofiler:30281269 vsdfh931cf:30280410 vshan820:30294714 pythondataviewer:30285072 vscod805cf:30301675 pythonvspyt200:30323110 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30404738 vscop804:30404766 vscop453:30404998 vsclayoutctrc:30405799 py55gd98cf:30408622 vscexrecpromp3c:30407757 azactmsalcf:30409288 ```
IllusionMH commented 2 years ago

/duplicate of https://github.com/microsoft/TypeScript/issues/47179

TS team needs a way to reproduce this issue. Please provide code that can help to reproduce this crash in issue linked above.