Recursive Schema Causes Type Instantiation Is Excessively Deep or Infinite

Offen
#1,830 1 Kommentar 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
typescript
Bereich
frontend

Rechercherichtung

Öffne zunächst den verlinkten StackBlitz, führe npm install aus und untersuche src/routes/+page.svelte mit TypeScript 5.9.2. Reproduziere den Typfehler für rekursive Schemas im Editor und ermittle, ob er aus der Verwendung des Formulars oder seinen Typdefinitionen stammt; abgeschlossen bedeutet, dass das Beispiel Typhinweise ohne den Fehler wegen übermäßiger Tiefe beibehält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Describe the bug

I am using a necessarily recursive schema for a feature to store logic as JSON. We're unable to actually have type validation due to the Type instantiation is excessively deep and possibly infinite error that shows up. I used the most recent zod syntax for the recursive schema as well.

Your minimal, reproducible example

https://stackblitz.com/edit/sveltejs-kit-template-default-vqnfhqkw?file=src%2Froutes%2F%2Bpage.svelte

Steps to reproduce
  1. Clone the StackBlitz
  2. Run npm install
  3. Open the +page.svelte file in your editor
Expected behavior

In my editor, I would like to still see type hints without type errors. I understand that type depth might be limited, but since I am using recursive components I am not actually managing this entirely in the UI.

How often does this bug happen?

Every time

Screenshots or Videos
Image
Platform
  • OS: MacOS
  • Browser: Chrome
TanStack Form adapter

None

TanStack Form version

v1.23.8

TypeScript version

v5.9.2

Additional context

I am using svelte-form, but that's not an option, you should add it to the TanStack Form adapter options for the GH issue form.

Vorherrschende Sprache
TypeScript
Sterne
6.8k
Forks
705
Ø Merge
1 T. 7 Std.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TanStack/form

Alle Issues in TanStack/form

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.