1.7 KiB
1.7 KiB
title, status, type, priority, tags, created_at, updated_at, parent
| title | status | type | priority | tags | created_at | updated_at | parent | |
|---|---|---|---|---|---|---|---|---|
| Bug: TypeScript build fails due to optional property type mismatches in journal components | completed | bug | high |
|
2026-03-20T15:39:00Z | 2026-03-20T19:17:34Z | 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
Summary of Changes
TypeScript build errors fixed by adding | undefined to optional property types in journal components:
JournalEditor.tsx:bossResultsandbossespropsJournalEntryView.tsx:bossResultandbosspropsJournalSection.tsx:bossResultsandbossesprops