{"record":{"id":"70818d43a8a491d4","repo":"microsoft/typescript-go","slug":"failed-to-dump-types-for-checker-d-w","errorCode":null,"errorMessage":"failed to dump types for checker %d: %w","messagePattern":"failed to dump types for checker (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tracing/tracing.go","lineNumber":443,"sourceCode":"\t}\n\ttr.tracers = append(tr.tracers, tracer)\n\ttr.legend = append(tr.legend, TraceRecord{\n\t\tConfigFilePath: tr.configFilePath,\n\t\tTracePath:      tr.tracePath,\n\t\tTypesPath:      typesPath,\n\t\tCheckerID:      checkerIndex,\n\t})\n\treturn tracer\n}\n\n// StopTracing finalizes the tracing session and writes all output files\nfunc (tr *Tracing) StopTracing() error {\n\t// Dump types from all tracers BEFORE acquiring the lock, because\n\t// DumpTypes → buildTypeDescriptor → Display() → TypeToString can\n\t// re-enter the checker which calls Push/Pop (which need tr.mu).\n\tfor _, tracer := range tr.tracers {\n\t\tif err := tracer.DumpTypes(); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to dump types for checker %d: %w\", tracer.checkerIndex, err)\n\t\t}\n\t}\n\n\ttr.mu.Lock()\n\tdefer tr.mu.Unlock()\n\n\t// Close the trace file(s)\n\tif tr.traceStarted.Load() {\n\t\t// Surface any buffered flush failure before attempting the final write.\n\t\tif tr.flushErr != nil {\n\t\t\ttr.traceContent.Reset()\n\t\t\ttr.traceStarted.Store(false)\n\t\t\treturn tr.flushErr\n\t\t}\n\t\t// Flush any remaining buffered content and close the JSON array.\n\t\tif err := tr.fs.AppendFile(tr.tracePath, tr.traceContent.String()+\"\\n]\\n\"); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to write trace file: %w\", err)\n\t\t}","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/tracing/tracing.go#L425-L461","documentation":"Error \"failed to dump types for checker %d: %w\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/tracing/tracing.go:443 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}