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 #38147

Closed
admmasters opened this issue Apr 23, 2020 · 7 comments
Closed

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

admmasters opened this issue Apr 23, 2020 · 7 comments
Assignees
Labels
Bug A bug in TypeScript Needs More Info The issue still hasn't been fully clarified Rescheduled This issue was previously scheduled to an earlier milestone

Comments

@admmasters
Copy link

Issue Type: Bug

TypeScript Version: 3.8.3
Steps to reproduce crash
1.
2.
3.
TS Server Error Stack

TypeError: Cannot read property 'flags' of undefined
    at Object.isGlobalScopeAugmentation (tsserver.js:13074:26)
    at initializeTypeChecker (tsserver.js:66347:33)
    at Object.createTypeChecker (tsserver.js:34785:9)
    at Object.getTypeChecker (tsserver.js:98416:79)
    at synchronizeHostData (tsserver.js:135228:21)
    at Proxy.getProgram (tsserver.js:135310:13)
    at InferredProject.Project.updateGraphWorker (tsserver.js:139786:53)
    at InferredProject.Project.updateGraph (tsserver.js:139729:42)
    at ProjectService.assignOrphanScriptInfoToInferredProject (tsserver.js:141705:25)
    at ProjectService.assignProjectToOpenedScriptInfo (tsserver.js:143132:26)
    at tsserver.js:143396:107
    at Object.mapDefined (tsserver.js:562:30)
    at ProjectService.applyChangesInOpenFiles (tsserver.js:143396:48)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:144260:46)
    at tsserver.js:146003:88
    at IOSession.Session.executeWithRequestId (tsserver.js:145994:28)
    at IOSession.Session.executeCommand (tsserver.js:146003:33)
    at IOSession.Session.onMessage (tsserver.js:146027:35)
    at Interface.<anonymous> (tsserver.js:147342: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 - Insiders 1.45.0-insider (bd26289, 2020-04-22T18:26:38.140Z)
OS version: Darwin x64 19.4.0

System Info
Item Value
CPUs Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz (12 x 2900)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 10, 15, 10
Memory (System) 32.00GB (4.50GB free)
Process Argv -psn_0_6813311
Screen Reader no
VM 14%
Extensions (32)
Extension Author (truncated) Version
rainbow-brackets 2gu 0.0.6
vscode-openapi 42C 3.0.1
vscode-apollo apo 1.15.3
svelte-intellisense ard 0.7.1
swagger-viewer Arj 2.2.2
toml be5 0.4.0
gitlens eam 10.2.1
vsc-material-theme Equ 32.5.0
vsc-material-theme-icons equ 1.1.4
prettier-vscode esb 4.5.0
vscode-pull-request-github Git 0.15.0
svelte-vscode Jam 0.9.3
vscode-styled-components jpo 0.0.29
vscode-deno jus 1.6.0
dotenv mik 1.0.1
vscode-azureappservice ms- 0.16.5
vscode-docker ms- 1.1.0
vscode-kubernetes-tools ms- 1.1.1
azure-account ms- 0.8.9
Go ms- 0.14.1
js-debug-companion ms- 0.0.4
vsliveshare ms- 1.0.2048
debugger-for-chrome msj 4.12.6
vscode-versionlens pfl 0.25.0
material-icon-theme PKi 4.0.1
vscode-graphql Pri 0.2.14
vscode-yaml red 0.7.2
code-settings-sync Sha 3.4.3
markdown-jira-preview tra 0.0.1
alphabetical-sorter ue 2.0.1
quokka-vscode Wal 1.0.288
json Zai 1.0.4

(4 theme extensions excluded)

@mjbvz mjbvz transferred this issue from microsoft/vscode Apr 23, 2020
@microsoft microsoft deleted a comment from vscodebot bot Apr 23, 2020
@mjbvz mjbvz removed their assignment Apr 23, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Apr 23, 2020

Please try upgrading your workspace to use typescript@next by installing this extension. After installing this extension and restarting VS Code, do you still see this issue?

@DanielRosenwasser
Copy link
Member

Ping @admmasters, any update?

@marcellomontemagno
Copy link

I encountered the very same error on [email protected] too but my stack trace looks quite different.

My issue is described in detail here: que-etc/resize-observer-polyfill#71

@admmasters
Copy link
Author

@DanielRosenwasser - sorry missed the reply will get back to you.

@sheetalkamat
Copy link
Member

Similar stack in #38556

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label May 14, 2020
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.0 milestone May 14, 2020
@sandersn
Copy link
Member

@marcellomontemagno I looked at your stack and it's not at all the same crash. It seems familiar so might be fixed by now. Can you:

  1. Upgrade to typescript@latest to see if the crash is still around.
  2. If so, try to reproduce the crash with just a call to tsc.
  3. If you can get that to crash, try removing as much of your code to see if the code in resize-obverver-polyfill is causing tsc to crash.

Then open a new bug with that info.

@sandersn sandersn added the Needs More Info The issue still hasn't been fully clarified label Jun 29, 2020
@sandersn
Copy link
Member

My first guess for the cause is an incorrect tree that hasn't had parent pointers set. It's possible that a fix for #38556 will also fix this, but it's hard to know without a repro.

@RyanCavanaugh RyanCavanaugh added the Rescheduled This issue was previously scheduled to an earlier milestone label Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Needs More Info The issue still hasn't been fully clarified Rescheduled This issue was previously scheduled to an earlier milestone
Projects
None yet
Development

No branches or pull requests

8 participants