microsoft / TypeScript

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

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

Closed fesnavarro closed 4 years ago

fesnavarro commented 4 years ago

Issue Type: Bug

TypeScript Version: 4.0.0-dev.20200519 Steps to reproduce crash 1. 2. 3. TS Server Error Stack

TypeError: Cannot read property 'flags' of undefined
    at getPropertyOfObjectType (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:44064:22)
    at getPropertyOfType (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:44664:24)
    at getExternalModuleMember (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37151:46)
    at getTargetOfImportSpecifier (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37235:28)
    at getTargetOfAliasDeclaration (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37293:28)
    at resolveAlias (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37332:30)
    at getSymbol (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:36002:38)
    at resolveNameHelper (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:36275:34)
    at resolveName (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:36259:20)
    at resolveEntityName (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37482:42)
    at getTargetOfAliasLikeExpression (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37264:29)
    at getTargetOfExportAssignment (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37253:28)
    at getTargetOfAliasDeclaration (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37298:28)
    at resolveAlias (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37332:30)
    at resolveSymbol (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37322:67)
    at resolveExternalModuleSymbol (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37713:36)
    at getTargetOfNamespaceExportDeclaration (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37240:28)
    at getTargetOfAliasDeclaration (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37300:28)
    at resolveAlias (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37332:30)
    at resolveSymbol (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:37322:67)
    at mergeSymbol (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:35790:42)
    at /home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:35903:47
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:35901:20)
    at mergeModuleAugmentation (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:35917:17)
    at initializeTypeChecker (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:68280:25)
    at Object.createTypeChecker (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:35624:9)
    at Object.getTypeChecker (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:100963:79)
    at synchronizeHostData (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:139263:21)
    at Object.getProgram (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:139345:13)
    at ConfiguredProject.Project.updateGraphWorker (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:143836:53)
    at ConfiguredProject.Project.updateGraph (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:143779:42)
    at ConfiguredProject.updateGraph (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:144573:63)
    at ProjectService.createLoadAndUpdateConfiguredProject (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:146226:25)
    at ProjectService.assignProjectToOpenedScriptInfo (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:147107:44)
    at /home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:147426:97
    at Object.flatMap (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:482:25)
    at ProjectService.applyChangesInOpenFiles (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:147426:41)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:148289:46)
    at /home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:150052:88
    at IOSession.Session.executeWithRequestId (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:150043:28)
    at IOSession.Session.executeCommand (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:150052:33)
    at IOSession.Session.onMessage (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:150076:35)
    at Interface.<anonymous> (/home/fesnavarro/.vscode/extensions/ms-vscode.vscode-typescript-next-4.0.20200519/node_modules/typescript/lib/tsserver.js:151392:27)
    at Interface.emit (events.js:203:13)
    at Interface._onLine (readline.js:316:10)
    at Interface._normalWrite (readline.js:461:12)
    at Socket.ondata (readline.js:172:10)
    at Socket.emit (events.js:203:13)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:276:11)
    at Socket.Readable.push (_stream_readable.js:210:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)

VS Code version: Code 1.45.1 (5763d909d5f12fe19f215cbfdd29a91c0fa9208a, 2020-05-14T08:27:22.494Z) OS version: Linux x64 5.3.0-51-generic

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz (8 x 3299)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: unavailable_off
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled| |Load (avg)|1, 1, 1| |Memory (System)|15.48GB (0.81GB free)| |Process Argv|--no-sandbox --unity-launch| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|plasma| |XDG_CURRENT_DESKTOP|KDE| |XDG_SESSION_DESKTOP|KDE| |XDG_SESSION_TYPE|x11|
Extensions (32) Extension|Author (truncated)|Version ---|---|--- vscode-css-formatter|aes|1.0.1 project-manager|ale|11.0.1 gitignore|cod|0.6.0 git-extension-pack|don|0.1.3 githistory|don|0.6.5 es7-react-js-snippets|dsz|2.7.1 gitlens|eam|10.2.1 git-project-manager|fel|1.7.1 docker-explorer|for|0.1.7 html-preview-vscode|geo|0.2.5 vscode-scl|Gun|0.0.10 docker-linter|hen|0.5.0 vscode-settings-cycler|hoo|1.0.1 githd|hui|2.2.4 latex-workshop|Jam|8.9.0 git-graph|mhu|1.22.0 vscode-docker|ms-|1.2.0 vscode-typescript-next|ms-|4.0.20200519 indent-rainbow|ode|7.4.0 docker-compose|p1c|0.3.5 material-icon-theme|PKi|4.1.0 git-merger|sha|0.4.1 code-settings-sync|Sha|3.4.3 markdown-preview-enhanced|shd|0.5.4 vba|spe|1.4.0 autoimport|ste|1.5.3 vscode-docker-ws|tii|0.4.1 vim|vsc|1.14.4 gitblame|wad|4.0.1 vscode-import-cost|wix|2.12.0 markdown-all-in-one|yzh|2.8.0 vscode-open-in-github|ziy|1.3.6
mjbvz commented 4 years ago

Seems like the same error as #37165

@fesnavarro Can you reliably trigger this issue?

fesnavarro commented 4 years ago

I changed my vscode version to old 1.39 than worked.

mjbvz commented 4 years ago

@fesnavarro That's good to know but it doesn't help us fix the issue. Can you share the code that causes this?