TypeScript-Fehler entschärfen

Übersetzt einen TS-Compilerfehler in verständliches Deutsch, zeigt die drei typischen Fixes und warnt vor den faulen.

Zuletzt geprüft 23. April 2026

Prompt

I'll give you a TypeScript compile error + the offending code.

Produce:
1. PLAIN-LANGUAGE ERKLÄRUNG (auf Deutsch, 1-2 Sätze) - was der Compiler wirklich sagt
2. WHY IT HAPPENS - die konkrete Regel im Typsystem, die hier greift
3. THREE FIXES, ranked from cleanest to laziest:
   - Fix A (clean): adjust types to reflect reality
   - Fix B (pragmatic): narrow/assert where safe
   - Fix C (lazy): `as any`, `@ts-ignore`, `!` - call this out as escape hatch
4. RED FLAG if the error hints at a deeper design issue (not just syntax)

Rules:
- Do not paste back the entire file; reference line by line
- If the error message text itself is confusing, translate (e.g., "Type 'X' is not assignable to 'Y'" → "dein X passt nicht in die Form Y weil Z")
- No "just use any" recommendation as first choice

Error:
[ERROR TEXT]

Code:
[CODE]

Wann nutzen

Für die häufige Situation, wo TS-Fehler kryptisch sind und man aus Frust `any` streut. Zwingt das Modell, den sauberen Fix zuerst vorzuschlagen.

Use-Cases

  • Generics-Fehler verstehen, die sich über 3 Zeilen strecken.
  • Strict-Mode-Migration: alte Codestellen sauber fixen.
  • Discriminated-Union-Narrowing-Problem.

Getestet mit

Fix C ist bewusst drin - manchmal ist eine Escape-Hatch die richtige Wahl. Aber nur wenn das Modell sie explizit als solche ausweist.