1.4 KiB
1.4 KiB
title, status, type, priority, created_at, updated_at, parent
| title | status | type | priority | created_at | updated_at | parent |
|---|---|---|---|---|---|---|
| Bug: TypeScript build fails due to optional property type mismatches in journal components | todo | bug | high | 2026-03-20T15:39:00Z | 2026-03-20T15:39:00Z | nuzlocke-tracker-bw1m |
The frontend TypeScript build fails with 3 errors due to exactOptionalPropertyTypes being enabled.
Errors
JournalEntryPage.tsx:76-bossResultsandbossesprops passed asundefinedtoJournalEditorJournalEntryPage.tsx:92-bossResultandbossprops passed asundefinedtoJournalEntryViewRunEncounters.tsx:1170-bossResultsandbossesprops passed asundefinedtoJournalSection
Root Cause
Optional props in interfaces are declared as prop?: Type but callers pass undefined values from React Query hooks. With exactOptionalPropertyTypes: true, TypeScript requires prop?: Type | undefined to allow explicit undefined values.
Fix
Update the interfaces in these files:
JournalEditor.tsxlines 9-10: change tobossResults?: BossResult[] | undefinedandbosses?: BossBattle[] | undefinedJournalEntryView.tsxlines 8-9: change tobossResult?: BossResult | null | undefinedandboss?: BossBattle | null | undefinedJournalSection.tsxlines 9-10: change tobossResults?: BossResult[] | undefinedandbosses?: BossBattle[] | undefined