microsoft/typescript-go · error
failed to write legend file: %w
Error message
failed to write legend file: %w
What it means
Error "failed to write legend file: %w" thrown in microsoft/typescript-go.
Source
Thrown at internal/tracing/tracing.go:478
return fmt.Errorf("failed to write trace file: %w", err)
}
tr.traceContent.Reset()
tr.traceStarted.Store(false)
}
// Sort legend entries by typesPath for deterministic output
slices.SortFunc(tr.legend, func(a, b TraceRecord) int {
return strings.Compare(a.TypesPath, b.TypesPath)
})
// Write the legend file
legendPath := tspath.CombinePaths(tr.traceDir, "legend.json")
legendData, err := json.MarshalIndent(tr.legend, "", " ")
if err != nil {
return fmt.Errorf("failed to marshal legend file: %w", err)
}
if err := tr.fs.WriteFile(legendPath, string(legendData)); err != nil {
return fmt.Errorf("failed to write legend file: %w", err)
}
return nil
}
// typeTracer is the per-checker tracer implementation
type typeTracer struct {
fs vfs.FS
checkerIndex int
typesPath string
types []TracedType
mu sync.Mutex
}
func (t *typeTracer) RecordType(typ TracedType) {
t.mu.Lock()
defer t.mu.Unlock()
t.types = append(t.types, typ)View on GitHub (pinned to 1bcfa18d79)
When it happens
Trigger: Thrown at internal/tracing/tracing.go:478 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/typescript-go@1bcfa18d79 (2026-08-16).
Data as JSON: /api/errors/4363907d96bd7823.
Report an issue: GitHub.