microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.06k stars 12.49k forks source link

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

Closed renetchi closed 2 years ago

renetchi commented 2 years ago

Issue Type: Bug

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

TypeScript Version: 4.6.0-dev.20220104

Steps to reproduce crash

  1. Open a project
  2. VSCode IntelliSense autocomplete not working

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 (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:57057:22)
    at getPropertyOfType (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:57727:24)
    at resolveESModuleSymbol (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:49830:54)
    at getTargetOfNamespaceImport (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:49015:28)
    at getTargetOfAliasDeclaration (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:49249:28)
    at resolveAlias (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:49294:30)
    at getSymbol (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:47849:38)
    at resolveNameHelper (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:48142:34)
    at resolveName (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:48125:20)
    at resolveEntityName (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:49466:42)
    at getTargetOfExportSpecifier (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:49206:17)
    at getTargetOfAliasDeclaration (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:49256:28)
    at resolveAlias (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:49294:30)
    at resolveSymbol (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:49284:67)
    at mergeSymbol (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:47635:42)
    at /home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:47750:47
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:47748:20)
    at mergeSymbol (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:47659:21)
    at /home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:47750:47
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:47748:20)
    at initializeTypeChecker (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:85133:21)
    at Object.createTypeChecker (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:47406:9)
    at Object.getTypeChecker (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:114662:79)
    at synchronizeHostData (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:160340:21)
    at Object.getProgram (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:160461:13)
    at ConfiguredProject.Project.updateGraphWorker (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:165476:53)
    at ConfiguredProject.Project.updateGraph (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:165405:42)
    at ConfiguredProject.updateGraph (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:166398:63)
    at ProjectService.createLoadAndUpdateConfiguredProject (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:168122:25)
    at ProjectService.assignProjectToOpenedScriptInfo (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:169205:44)
    at /home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:169545:97
    at Object.flatMap (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:502:25)
    at ProjectService.applyChangesInOpenFiles (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:169545:41)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:170703:46)
    at /home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:172636:88
    at IOSession.Session.executeWithRequestId (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:172627:28)
    at IOSession.Session.executeCommand (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:172636:33)
    at IOSession.Session.onMessage (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:172662:35)
    at Interface.<anonymous> (/home/irene/.vscode/extensions/ms-vscode.vscode-typescript-next-4.6.20220104/node_modules/typescript/lib/tsserver.js:175267: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.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3, 2021-12-15T09:39:46.686Z) OS version: Linux x64 5.11.0-43-generic snap Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 3751)| |GPU Status|2d_canvas: unavailable_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software| |Load (avg)|5, 4, 3| |Memory (System)|15.49GB (1.17GB free)| |Process Argv|--no-sandbox --force-user-env --unity-launch --crash-reporter-id 4cbcf0ce-4320-43d4-8472-3e39ed1b9969| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|x11|
Extensions (29) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|2.1.0 markdown-mermaid|bie|1.13.1 mermaid-markdown-syntax-highlighting|bpr|1.2.2 bracket-pair-colorizer-2|Coe|0.2.2 vscode-svgviewer|css|2.0.0 vscode-eslint|dba|2.2.2 es7-react-js-snippets|dsz|3.1.1 gitlens|eam|11.7.0 prettier-vscode|esb|9.1.0 vscode-pull-request-github|Git|0.34.2 yuml|Jai|3.5.1 vscode-peacock|joh|4.0.0 vscode-docker|ms-|1.18.0 remote-containers|ms-|0.209.6 remote-ssh|ms-|0.70.0 remote-ssh-edit|ms-|0.70.0 remote-wsl|ms-|0.63.13 vscode-remote-extensionpack|ms-|0.21.0 vscode-typescript-next|ms-|4.6.20220104 vsliveshare|ms-|1.0.5201 vsliveshare-audio|ms-|0.1.91 vsliveshare-pack|ms-|0.4.0 indent-rainbow|ode|8.2.2 vscodeintellicode|Vis|1.2.15 vscode-icons|vsc|11.8.0 vscode-mermaid-preview|vst|1.6.2 vscode-import-cost|wix|2.15.0 JavaScriptSnippets|xab|1.8.0 material-theme|zhu|3.13.9 (4 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythontb:30283811 pythonvspyt551:30345470 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30384385 pythondataviewer:30285071 vscod805:30301674 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30410667 vscop804:30404766 vscop453:30404998 vsrem710cf:30416617 vscexrecpromp3t3:30407764 ```
mjbvz commented 2 years ago

Please share a project that causes this issue so that we can investigate this

sandersn commented 2 years ago

Should be fixed by https://github.com/microsoft/TypeScript/pull/47348