fix: Object.values null safety + Docker dev build
Build and Publish Mana Loop Docker Image / build-and-publish (push) Has been cancelled

- Change Dockerfile to use development build (better error messages)
- Add || {} fallbacks to all Object.values() calls accessing state
- Fixes "Cannot convert undefined or null to object" browser error during SSR/hydration
- Verified TypeScript compilation and Next.js build successful

Files modified:
- Dockerfile
- src/app/page.tsx
- src/components/game/tabs/StatsTab.tsx
- src/components/game/StatsTab/LoopStatsSection.tsx
- src/components/game/StatsTab/ElementStatsSection.tsx
- src/components/game/tabs/AttunementsTab.tsx
- src/components/game/tabs/GolemancyTab.tsx
- src/lib/game/effects.ts
- src/lib/game/utils/combat-utils.ts
- src/lib/game/crafting-loot.ts
- src/components/game/LootInventory/LootInventoryDisplay.tsx
- src/components/game/LootInventory/index.tsx
- src/components/game/crafting/EnchantmentDesigner/utils.ts
This commit is contained in:
Refactoring Agent
2026-05-04 11:03:11 +02:00
parent 98ab975fb9
commit 0eabd604b0
18 changed files with 46 additions and 60 deletions
@@ -55,7 +55,7 @@ export function LootInventoryDisplay({
const [deleteConfirm, setDeleteConfirm] = useState<{ type: 'material' | 'equipment'; id: string; name: string } | null>(null);
// Count items
const materialCount = Object.values(inventory.materials).reduce((a, b) => a + b, 0);
const materialCount = Object.values(inventory.materials || {}).reduce((a, b) => a + b, 0);
const essenceCount = elements ? Object.entries(elements).reduce((a, [id, e]) => id === 'transference' ? a : a + e.current, 0) : 0;
const blueprintCount = inventory.blueprints.length;
const equipmentCount = Object.keys(equipmentInstances).length;
+1 -1
View File
@@ -55,7 +55,7 @@ export function LootInventoryDisplay({
const [deleteConfirm, setDeleteConfirm] = useState<{ type: 'material' | 'equipment'; id: string; name: string } | null>(null);
// Count items
const materialCount = Object.values(inventory.materials).reduce((a: number, b: number) => a + b, 0);
const materialCount = Object.values(inventory.materials || {}).reduce((a: number, b: number) => a + b, 0);
// Calculate essence count
let essenceCount = 0;