microsoft/typescript-go · error

failed to dump types for checker %d: %w

Error message

failed to dump types for checker %d: %w

What it means

Error "failed to dump types for checker %d: %w" thrown in microsoft/typescript-go.

Source

Thrown at internal/tracing/tracing.go:443

	}
	tr.tracers = append(tr.tracers, tracer)
	tr.legend = append(tr.legend, TraceRecord{
		ConfigFilePath: tr.configFilePath,
		TracePath:      tr.tracePath,
		TypesPath:      typesPath,
		CheckerID:      checkerIndex,
	})
	return tracer
}

// StopTracing finalizes the tracing session and writes all output files
func (tr *Tracing) StopTracing() error {
	// Dump types from all tracers BEFORE acquiring the lock, because
	// DumpTypes → buildTypeDescriptor → Display() → TypeToString can
	// re-enter the checker which calls Push/Pop (which need tr.mu).
	for _, tracer := range tr.tracers {
		if err := tracer.DumpTypes(); err != nil {
			return fmt.Errorf("failed to dump types for checker %d: %w", tracer.checkerIndex, err)
		}
	}

	tr.mu.Lock()
	defer tr.mu.Unlock()

	// Close the trace file(s)
	if tr.traceStarted.Load() {
		// Surface any buffered flush failure before attempting the final write.
		if tr.flushErr != nil {
			tr.traceContent.Reset()
			tr.traceStarted.Store(false)
			return tr.flushErr
		}
		// Flush any remaining buffered content and close the JSON array.
		if err := tr.fs.AppendFile(tr.tracePath, tr.traceContent.String()+"\n]\n"); err != nil {
			return fmt.Errorf("failed to write trace file: %w", err)
		}

View on GitHub (pinned to 1bcfa18d79)

When it happens

Trigger: Thrown at internal/tracing/tracing.go:443 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/70818d43a8a491d4. Report an issue: GitHub.