Files
nuzlocke-tracker/.beans/archive/nuzlocke-tracker-d5ht--bug-typescript-build-fails-due-to-optional-propert.md
Julian Tabel a6cb309b8b
All checks were successful
CI / backend-tests (push) Successful in 28s
CI / frontend-tests (push) Successful in 28s
chore: archive 42 completed/scrapped beans
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 21:31:23 +01:00

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
failed
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

  1. JournalEntryPage.tsx:76 - bossResults and bosses props passed as undefined to JournalEditor
  2. JournalEntryPage.tsx:92 - bossResult and boss props passed as undefined to JournalEntryView
  3. RunEncounters.tsx:1170 - bossResults and bosses props passed as undefined to JournalSection

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.tsx lines 9-10: change to bossResults?: BossResult[] | undefined and bosses?: BossBattle[] | undefined
  • JournalEntryView.tsx lines 8-9: change to bossResult?: BossResult | null | undefined and boss?: BossBattle | null | undefined
  • JournalSection.tsx lines 9-10: change to bossResults?: BossResult[] | undefined and bosses?: BossBattle[] | undefined

Summary of Changes

TypeScript build errors fixed by adding | undefined to optional property types in journal components:

  • JournalEditor.tsx: bossResults and bosses props
  • JournalEntryView.tsx: bossResult and boss props
  • JournalSection.tsx: bossResults and bosses props