Files
nuzlocke-tracker/.beans/nuzlocke-tracker-d5ht--bug-typescript-build-fails-due-to-optional-propert.md
Julian Tabel 088cd35002
Some checks failed
CI / frontend-tests (push) Has been cancelled
CI / backend-tests (push) Has been cancelled
add Ko-fi bean
2026-03-20 16:39:52 +01:00

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

  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