Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pavloemmgt opened this issue Dec 17, 2021 · 8 comments
Closed

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

pavloemmgt opened this issue Dec 17, 2021 · 8 comments
Assignees
Labels
Bug A bug in TypeScript

Comments

@pavloemmgt
Copy link

Issue Type: Bug

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

TypeScript Version: 4.6.0-dev.20211216

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 (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:57056:22)
    at getPropertyOfType (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:57726:24)
    at resolveESModuleSymbol (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:49830:54)
    at getTargetOfNamespaceImport (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:49015:28)
    at getTargetOfAliasDeclaration (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:49249:28)
    at resolveAlias (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:49294:30)
    at getSymbol (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:47849:38)
    at resolveNameHelper (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:48142:34)
    at resolveName (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:48125:20)
    at resolveEntityName (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:49466:42)
    at resolveEntityName (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:49474:33)
    at getSymbolOfPartOfRightHandSideOfImportEquals (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:49426:24)
    at getTargetOfImportEqualsDeclaration (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:48878:28)
    at getTargetOfAliasDeclaration (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:49245:28)
    at resolveAlias (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:49294:30)
    at resolveSymbol (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:49284:67)
    at mergeSymbol (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:47635:42)
    at c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:47750:47
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:47748:20)
    at mergeSymbol (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:47659:21)
    at c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:47750:47
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:47748:20)
    at mergeModuleAugmentation (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:47764:17)
    at initializeTypeChecker (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:85163:25)
    at Object.createTypeChecker (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:47406:9)
    at Object.getTypeChecker (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:114656:79)
    at synchronizeHostData (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:160334:21)
    at Proxy.getProgram (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:160455:13)
    at ConfiguredProject.Project.updateGraphWorker (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:165470:53)
    at ConfiguredProject.Project.updateGraph (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:165399:42)
    at ConfiguredProject.updateGraph (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:166392:63)
    at ProjectService.createLoadAndUpdateConfiguredProject (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:168116:25)
    at ProjectService.assignProjectToOpenedScriptInfo (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:169199:44)
    at c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:169539:97
    at Object.flatMap (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:502:25)
    at ProjectService.applyChangesInOpenFiles (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:169539:41)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:170697:46)
    at c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:172630:88
    at IOSession.Session.executeWithRequestId (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:172621:28)
    at IOSession.Session.executeCommand (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:172630:33)
    at IOSession.Session.onMessage (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:172656:35)
    at Interface.<anonymous> (c:\Users\Pavel.EMMGT\.vscode\extensions\ms-vscode.vscode-typescript-next-4.6.20211216\node_modules\typescript\lib\tsserver.js:175261: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.1 (fe719cd3e5825bf14e14182fddeb88ee8daf044f, 2021-12-14T02:13:54.292Z)
OS version: Windows_NT x64 10.0.19044
Restricted Mode: No
Remote OS version: Linux x64 5.4.72-microsoft-standard-WSL2

System Info
Item Value
CPUs Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz (4 x 3408)
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) 15.93GB (3.16GB free)
Process Argv --crash-reporter-id 5732566f-506a-4de9-9d44-e685b013151f
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.4.72-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz (4 x 3408)
Memory (System) 12.43GB (3.52GB free)
VM 0%
Extensions (34)
Extension Author (truncated) Version
vscode-angular2-files ale 1.6.4
ng-template Ang 13.1.0
angular2-snippets dan 1.0.21
dart-code Dar 3.29.0
es7-react-js-snippets dsz 3.1.1
gitlens eam 11.7.0
vscode-html-css ecm 1.10.2
EditorConfig Edi 0.16.4
prettier-vscode esb 9.0.0
angular2-switcher inf 0.3.4
vscode-angular2-emmet jak 2.0.3
Angular2 joh 12.0.0
TypeScriptImport kev 1.17.0
ng-bootstrap-snippets ktr 1.0.0
node-module-intellisense lei 1.5.0
pretty-formatter mbl 0.2.2
Angular-BeastCode Mik 10.0.3
vscode-extension-auto-import mop 1.3.3
vscode-scss mrm 0.10.0
csharp ms- 1.23.17
remote-containers ms- 0.209.6
remote-wsl ms- 0.63.13
vscode-typescript-next ms- 4.6.20211216
vscode-typescript-tslint-plugin ms- 1.3.3
angular2-inline nat 0.0.17
vscode-extension-auto-import Nuc 1.4.3
typescript-hero rbb 3.0.0
prettier-now rem 1.4.9
vs-code-prettier-eslint rve 3.0.4
prettier-vscode Sim 2.0.7
prettier-plus svi 4.2.2
sass-indented syl 1.8.18
symfony-vscode The 1.0.2
html-preview-vscode tht 0.2.5
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
pythontb:30283811
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30384386
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
vscop804:30404766
vscop341:30404997
vsrem710:30405998
vscexrecpromp3t2:30407763

@gjsjohnmurray
Copy link

/assign @mjbvz

@ghost ghost assigned mjbvz Dec 17, 2021
@pavloemmgt
Copy link
Author

I also get the same error when change TS version to 4.5.4

@mjbvz mjbvz transferred this issue from microsoft/vscode Dec 17, 2021
@mjbvz
Copy link
Contributor

mjbvz commented Dec 17, 2021

Can you please share a project that triggers this issue?

@mjbvz mjbvz removed their assignment Dec 17, 2021
sandersn added a commit that referenced this issue Dec 17, 2021
This can happen during symbol merging when initialising the checker,
because global types aren't set until after symbols are merged.

May stop the crashes in #47179, #47181, #47180.
Does not address the underlying problem of needing to resolve aliases,
and therefore names, during symbol merging when initialising the
checker.
@pavloemmgt
Copy link
Author

Whe I try to report issue, I receive popup with text:
Please update your TypeScript version
The workspace is using an old version of TypeScript (4.6.0-dev.20211221).

Before reporting an issue, please update the workspace to use the latest stable TypeScript release to make sure the bug has not already been fixed.

@pavloemmgt
Copy link
Author

Can you please share a project that triggers this issue?

no I can't

@pavloemmgt
Copy link
Author

Can you please share a project that triggers this issue?

I can share just a part of package.json
"devDependencies": { "@typescript-eslint/eslint-plugin": "^2.17.0", "eslint": "^6.8.0", "eslint-config-airbnb-typescript": "^7.0.0", "eslint-config-prettier": "^6.10.0", "eslint-import-resolver-lerna": "^1.1.0", "eslint-plugin-eslint-comments": "^3.1.2", "eslint-plugin-import": "^2.20.0", "eslint-plugin-jest": "^23.6.0", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-react": "^7.18.0", "eslint-plugin-react-hooks": "^4.0.0", "eslint-plugin-unicorn": "^19.0.1", "lerna": "^3.20.2", "lint-staged": "11.0.0", "majestic": "^1.6.2", "patch-package": "^6.2.2", "postinstall-postinstall": "^2.1.0", "prettier": "^2.0.2", "husky": "^7.0.0" }, "dependencies": { "@types/nice-try": "^2.1.0", "@types/react-beautiful-dnd": "^13.1.1", "tslib": "2.2.0", "webrtc-adapter": "^7.7.0", "yarn": "^1.22.17" },

@otto-liljalaakso-nt
Copy link

Can you please share a project that triggers this issue?

Does this help?

#47038 (comment)

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jan 4, 2022
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.7.0 milestone Jan 4, 2022
@sandersn
Copy link
Member

Should be fixed by #47348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

6 participants